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

Commit91e76cf

Browse files
[DependencyInjection] Ignore unused bindings defined by attribute
1 parent8148fdd commit91e76cf

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ private static function registerForAutoconfiguration(ContainerBuilder $container
8282
],
8383
],
8484
],
85-
$class->getFileName()
85+
$class->getFileName(),
86+
false
8687
);
8788
};
8889

‎src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ private function parseImports(array $content, string $file)
220220
}
221221
}
222222

223-
privatefunctionparseDefinitions(array$content,string$file)
223+
privatefunctionparseDefinitions(array$content,string$file,bool$trackBindings =true)
224224
{
225225
if (!isset($content['services'])) {
226226
return;
@@ -253,7 +253,7 @@ private function parseDefinitions(array $content, string $file)
253253
$this->isLoadingInstanceof =false;
254254
$defaults =$this->parseDefaults($content,$file);
255255
foreach ($content['services']as$id =>$service) {
256-
$this->parseDefinition($id,$service,$file,$defaults);
256+
$this->parseDefinition($id,$service,$file,$defaults,false,$trackBindings);
257257
}
258258
}
259259

@@ -342,7 +342,7 @@ private function isUsingShortSyntax(array $service): bool
342342
*
343343
* @throws InvalidArgumentException When tags are invalid
344344
*/
345-
privatefunctionparseDefinition(string$id,$service,string$file,array$defaults,bool$return =false)
345+
privatefunctionparseDefinition(string$id,$service,string$file,array$defaults,bool$return =false,bool$trackBindings =true)
346346
{
347347
if (preg_match('/^_[a-zA-Z0-9_]*$/',$id)) {
348348
thrownewInvalidArgumentException(sprintf('Service names that start with an underscore are reserved. Rename the "%s" service or define it in XML instead.',$id));
@@ -666,7 +666,7 @@ private function parseDefinition(string $id, $service, string $file, array $defa
666666
$bindingType =$this->isLoadingInstanceof ? BoundArgument::INSTANCEOF_BINDING : BoundArgument::SERVICE_BINDING;
667667
foreach ($bindingsas$argument =>$value) {
668668
if (!$valueinstanceof BoundArgument) {
669-
$bindings[$argument] =newBoundArgument($value,true,$bindingType,$file);
669+
$bindings[$argument] =newBoundArgument($value,$trackBindings,$bindingType,$file);
670670
}
671671
}
672672
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp