[ 'class' => fn() => new Logger('logger') ], HttpClientInterface::class => [ 'class' => function (): HttpClientInterface { return new CurlHttpClient( defaultOptions: Config::get('http.default.options', []), maxHostConnections: Config::get('http.default.maxHostConnections', 25), maxPendingPushes: Config::get('http.default.maxPendingPushes', 50), ); } ], StateInterface::class => [ 'class' => fn() => new StateEntity([]) ], CacheInterface::class => [ 'class' => fn() => new Psr16Cache(new FilesystemAdapter(directory: Config::get('cache.config.directory'))) ], UriInterface::class => [ 'class' => fn() => new Uri(''), 'shared' => false, ], StorageInterface::class => [ 'class' => function (LoggerInterface $logger): StorageInterface { $adapter = (new PDOAdapter($logger))->setUp(Config::get('storage.opts', [])); if (true !== $adapter->isMigrated()) { $adapter->migrations(StorageInterface::MIGRATE_UP); } return $adapter; }, 'args' => [ LoggerInterface::class, ], ], MemoryMapper::class => [ 'class' => function (LoggerInterface $logger, StorageInterface $storage): ImportInterface { return (new MemoryMapper($logger, $storage))->setUp(Config::get('mapper.import.opts', [])); }, 'args' => [ LoggerInterface::class, StorageInterface::class, ], ], DirectMapper::class => [ 'class' => function (LoggerInterface $logger, StorageInterface $storage): ImportInterface { return (new DirectMapper($logger, $storage))->setUp(Config::get('mapper.import.opts', [])); }, 'args' => [ LoggerInterface::class, StorageInterface::class, ], ], ImportInterface::class => [ 'class' => function (ImportInterface $mapper): ImportInterface { return $mapper; }, 'args' => [ MemoryMapper::class ], ], ExportMapper::class => [ 'class' => function (StorageInterface $storage): ExportInterface { return (new ExportMapper($storage))->setUp(Config::get('mapper.export.opts', [])); }, 'args' => [ StorageInterface::class, ], ], ExportInterface::class => [ 'class' => function (ExportInterface $mapper): ExportInterface { return $mapper; }, 'args' => [ ExportMapper::class ], ], ]; })();