Skip to content

Commit

Permalink
Fixed compatibility with nette/di ~3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tg666 committed Nov 21, 2023
1 parent d905ce1 commit 362f586
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"friendsofphp/php-cs-fixer": "^3.17",
"kubawerlos/php-cs-fixer-custom-fixers": "^3.14",
"mockery/mockery": "^1.6",
"nette/bootstrap": "^3.0",
"nette/bootstrap": "^3.1",
"nette/caching": "^3.1",
"nette/di": "^3.0",
"nette/tester": "^2.4",
Expand Down
12 changes: 6 additions & 6 deletions src/Bridge/Nette/DI/AmpClientExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function loadConfiguration(): void
$builder->addDefinition($this->prefix('config'))
->setAutowired(false)
->setType(ClientConfig::class)
->setCreator($this->createClientConfigCreator($config));
->setFactory($this->createClientConfigCreator($config));

$cacheStorageCreator = null === $config->cache->storage
? new Statement(NoCacheStorage::class)
Expand All @@ -90,29 +90,29 @@ public function loadConfiguration(): void
$builder->addDefinition($this->prefix('cacheStorage'))
->setAutowired(false)
->setType(CacheStorageInterface::class)
->setCreator($cacheStorageCreator);
->setFactory($cacheStorageCreator);

$builder->addDefinition($this->prefix('responseHydrator'))
->setAutowired(false)
->setType(ResponseHydratorInterface::class)
->setCreator(ResponseHydrator::class);
->setFactory(ResponseHydrator::class);

$builder->addDefinition($this->prefix('responseHydrator.handler.bannersRequest'))
->setAutowired(false)
->setType(ResponseHydratorHandlerInterface::class)
->setCreator(BannersResponseHydratorHandler::class);
->setFactory(BannersResponseHydratorHandler::class);

$builder->addDefinition($this->prefix('httpClientFactory'))
->setAutowired(false)
->setType(HttpClientFactoryInterface::class)
->setCreator(HttpClientFactory::class, [
->setFactory(HttpClientFactory::class, [
'responseHydrator' => $this->prefix('@responseHydrator'),
'guzzleClientConfig' => $config->http->guzzle_config,
]);

$builder->addDefinition($this->prefix('ampClient'))
->setType(AmpClientInterface::class)
->setCreator(AmpClient::class, [
->setFactory(AmpClient::class, [
'config' => $this->prefix('@config'),
'httpClientFactory' => $this->prefix('@httpClientFactory'),
'cacheStorage' => $this->prefix('@cacheStorage'),
Expand Down

0 comments on commit 362f586

Please sign in to comment.