getOption(self::OPTION_DRIVER_OPTIONS, []); if (empty($options[$driverClass]) || empty($config['connection']['driverOptions'])) { return $config; } foreach ($options[$driverClass]['driverOptions'] as $option) { $config = $this->feedConfigWithService($config, $option); } return $config; } private function feedConfigWithService(array $config, string $option): array { if (empty($config['connection']['driverOptions'][$option])) { return $config; } if (is_object($config['connection']['driverOptions'][$option])) { return $config; } $config['connection']['driverOptions'][$option] = $this->getServiceLocator() ->get($config['connection']['driverOptions'][$option]); return $config; } }