Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Use lowercase config key to get configuration from container #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/AbstractConfigFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function canCreate(ContainerInterface $container, $requestedName)
return true;
}

if (! $container->has('Config')) {
if (! $container->has('config')) {
return false;
}

Expand All @@ -70,7 +70,7 @@ public function canCreate(ContainerInterface $container, $requestedName)
return false;
}

$config = $container->get('Config');
$config = $container->get('config');
return isset($config[$key]);
}

Expand Down Expand Up @@ -107,7 +107,7 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
return $this->configs[$key];
}

$config = $container->get('Config');
$config = $container->get('config');
$this->configs[$requestedName] = $this->configs[$key] = $config[$key];
return $config[$key];
}
Expand Down
2 changes: 1 addition & 1 deletion test/AbstractConfigFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function setUp()
AbstractConfigFactory::class,
],
'services' => [
'Config' => $this->config,
'config' => $this->config,
],
]);
$smConfig->configureServiceManager($this->serviceManager);
Expand Down