8000 [DI] Remove hasty verification of unused env variables by fefas · Pull Request #22726 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI] Remove hasty verification of unused env variables #22726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
[DI] Do not throw exception if there is unused env var in config
  • Loading branch information
fefas committed May 17, 2017
commit 6f9cf7dc0d039d8c3de829c7684e28365564d5f7
10 changes: 0 additions & 10 deletions src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,6 @@ public function dump(array $options = array())
;
$this->targetDirRegex = null;

$unusedEnvs = array();
foreach ($this->container->getEnvCounters() as $env => $use) {
if (!$use) {
$unusedEnvs[] = $env;
}
}
if ($unusedEnvs) {
throw new EnvParameterException($unusedEnvs);
}

return $code;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,19 +299,6 @@ public function testEnvParameter()
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services26.php', $dumper->dump(), '->dump() dumps inline definitions which reference service_container');
}

/**
* @expectedException \Symfony\Component\DependencyInjection\Exception\EnvParameterException
* @expectedExceptionMessage Incompatible use of dynamic environment variables "FOO" found in parameters.
*/
public function testUnusedEnvParameter()
{
$container = new ContainerBuilder();
$container->getParameter('env(FOO)');
$container->compile();
$dumper = new PhpDumper($container);
$dumper->dump();
}

public function testInlinedDefinitionReferencingServiceContainer()
{
$container = new ContainerBuilder();
Expand Down
0