Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 949c6da

Browse filesBrowse files
committed
Use EnvParameterException
1 parent 51e16bb commit 949c6da
Copy full SHA for 949c6da

File tree

2 files changed

+5
-4
lines changed
Filter options

2 files changed

+5
-4
lines changed

‎src/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Compiler;
1313

1414
use Symfony\Component\DependencyInjection\ContainerBuilder;
15+
use Symfony\Component\DependencyInjection\Exception\EnvParameterException;
1516
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
1617

1718
/**
@@ -78,14 +79,14 @@ public function process(ContainerBuilder $container)
7879

7980
$resolvedId = $container->resolveEnvPlaceholders($id, null, $usedEnvs);
8081
if (null !== $usedEnvs) {
81-
throw new RuntimeException(sprintf('A service name ("%s") cannot contain dynamic values.', $resolvedId));
82+
throw new EnvParameterException($usedEnvs, null, sprintf('A service name ("%s") cannot contain dynamic values.', $resolvedId));
8283
}
8384
}
8485

8586
foreach ($container->getAliases() as $id => $alias) {
8687
$resolvedId = $container->resolveEnvPlaceholders($id, null, $usedEnvs);
8788
if (null !== $usedEnvs) {
88-
throw new RuntimeException(sprintf('An alias name ("%s") cannot contain dynamic values.', $resolvedId));
89+
throw new EnvParameterException($usedEnvs, null, sprintf('An alias name ("%s") cannot contain dynamic values.', $resolvedId));
8990
}
9091
}
9192
}

‎src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function testInvalidTags()
7777
}
7878

7979
/**
80-
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
80+
* @expectedException \Symfony\Component\DependencyInjection\Exception\EnvParameterException
8181
*/
8282
public function testDynamicServiceName()
8383
{
@@ -89,7 +89,7 @@ public function testDynamicServiceName()
8989
}
9090

9191
/**
92-
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
92+
* @expectedException \Symfony\Component\DependencyInjection\Exception\EnvParameterException
9393
*/
9494
public function testDynamicAliasName()
9595
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.