![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/laminas/laminas-db/src/Adapter/ |
<?php namespace Laminas\Db\Adapter; use Psr\Container\ContainerInterface; class AdapterServiceDelegator { /** @var string */ private $adapterName; public function __construct(string $adapterName = AdapterInterface::class) { $this->adapterName = $adapterName; } public static function __set_state(array $state): self { return new self($state['adapterName'] ?? AdapterInterface::class); } /** @return AdapterInterface */ public function __invoke( ContainerInterface $container, string $name, callable $callback, ?array $options = null ) { $instance = $callback(); if (! $instance instanceof AdapterAwareInterface) { return $instance; } if (! $container->has($this->adapterName)) { return $instance; } $databaseAdapter = $container->get($this->adapterName); if (! $databaseAdapter instanceof Adapter) { return $instance; } $instance->setDbAdapter($databaseAdapter); return $instance; } }