File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1111#[AutowiredService]
1212final class ClassNameCheck
1313{
14+ /** @var RestrictedClassNameUsageExtension[] $extensions */
15+ private array $ extensions ;
1416
1517 public function __construct (
1618 private ClassCaseSensitivityCheck $ classCaseSensitivityCheck ,
@@ -19,6 +21,7 @@ public function __construct(
1921 private Container $ container ,
2022 )
2123 {
24+ $ this ->extensions = $ this ->container ->getServicesByTag (RestrictedClassNameUsageExtension::CLASS_NAME_EXTENSION_TAG );
2225 }
2326
2427 /**
@@ -47,9 +50,7 @@ public function checkClassNames(
4750 return $ errors ;
4851 }
4952
50- /** @var RestrictedClassNameUsageExtension[] $extensions */
51- $ extensions = $ this ->container ->getServicesByTag (RestrictedClassNameUsageExtension::CLASS_NAME_EXTENSION_TAG );
52- if ($ extensions === []) {
53+ if ($ this ->extensions === []) {
5354 return $ errors ;
5455 }
5556
@@ -59,7 +60,7 @@ public function checkClassNames(
5960 }
6061
6162 $ classReflection = $ this ->reflectionProvider ->getClass ($ pair ->getClassName ());
62- foreach ($ extensions as $ extension ) {
63+ foreach ($ this -> extensions as $ extension ) {
6364 $ restrictedUsage = $ extension ->isRestrictedClassNameUsage ($ classReflection , $ scope , $ location );
6465 if ($ restrictedUsage === null ) {
6566 continue ;
You can’t perform that action at this time.
0 commit comments