Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commite5491ab

Browse files
committed
CheckExceptionOnInvalidReferenceBehaviorPass just after RemoveUnusedDefinitionsPass
1 parentf409d54 commite5491ab

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public function __construct()
7474
$this->beforeRemovingPasses = [
7575
-100 => [
7676
newResolvePrivatesPass(),
77-
newCheckExceptionOnInvalidReferenceBehaviorPass(),
7877
],
7978
];
8079

@@ -83,6 +82,7 @@ public function __construct()
8382
newReplaceAliasByActualDefinitionPass(),
8483
newRemoveAbstractDefinitionsPass(),
8584
newRemoveUnusedDefinitionsPass(),
85+
newCheckExceptionOnInvalidReferenceBehaviorPass(),
8686
newInlineServiceDefinitionsPass(newAnalyzeServiceReferencesPass()),
8787
newAnalyzeServiceReferencesPass(),
8888
newDefinitionErrorExceptionPass(),

‎src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,25 @@ public function testGetThrownServiceNotFoundExceptionWithCorrectServiceId()
13381338
$container->compile();
13391339
}
13401340

1341+
publicfunctiontestUnusedServiceRemovedByPassAndServiceNotFoundExceptionWasNotThrown()
1342+
{
1343+
$container =newContainerBuilder();
1344+
$container->register('service', \stdClass::class)
1345+
->setPublic(false)
1346+
->addArgument([
1347+
'non_existent_service' =>newReference('non_existent_service'),
1348+
])
1349+
;
1350+
1351+
try {
1352+
$container->compile();
1353+
}catch (ServiceNotFoundException$e) {
1354+
$this->fail('Should not be thrown');
1355+
}
1356+
1357+
$this->addToAssertionCount(1);
1358+
}
1359+
13411360
publicfunctiontestServiceLocator()
13421361
{
13431362
$container =newContainerBuilder();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp