Skip to content

Commit 2776f5d

Browse files
committed
Added missing interface/tag combos to AutowiredAttributeServicesExtension
1 parent 6194cf2 commit 2776f5d

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

conf/config.neon

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,6 @@ services:
311311
tags:
312312
- phpstan.parser.richParserNodeVisitor
313313

314-
-
315-
class: PHPStan\Parser\LastConditionVisitor
316-
tags:
317-
- phpstan.parser.richParserNodeVisitor
318-
319314
-
320315
class: PHPStan\Parser\TypeTraverserInstanceofVisitor
321316
tags:
@@ -488,6 +483,9 @@ services:
488483
arguments:
489484
parser: @defaultAnalysisParser
490485

486+
-
487+
class: PHPStan\Dependency\ExportedNodeVisitor
488+
491489
-
492490
class: PHPStan\DependencyInjection\Container
493491
factory: PHPStan\DependencyInjection\MemoizingContainer
@@ -631,6 +629,9 @@ services:
631629
-
632630
class: PHPStan\Reflection\Annotations\AnnotationsPropertiesClassReflectionExtension
633631

632+
-
633+
class: PHPStan\Reflection\BetterReflection\SourceLocator\CachingVisitor
634+
634635
-
635636
class: PHPStan\Reflection\BetterReflection\SourceLocator\FileNodesFetcher
636637
arguments:

src/Dependency/ExportedNodeVisitor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
use PhpParser\Node;
66
use PhpParser\NodeVisitor;
77
use PhpParser\NodeVisitorAbstract;
8-
use PHPStan\DependencyInjection\AutowiredService;
98
use PHPStan\ShouldNotHappenException;
109

11-
#[AutowiredService]
1210
final class ExportedNodeVisitor extends NodeVisitorAbstract
1311
{
1412

src/DependencyInjection/AutowiredAttributeServicesExtension.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44

55
use Nette\DI\CompilerExtension;
66
use olvlvl\ComposerAttributeCollector\Attributes;
7+
use PhpParser\NodeVisitor;
78
use PHPStan\Analyser\ResultCache\ResultCacheMetaExtension;
89
use PHPStan\Analyser\TypeSpecifierFactory;
910
use PHPStan\Broker\BrokerFactory;
11+
use PHPStan\Collectors\Collector;
12+
use PHPStan\Collectors\RegistryFactory as CollectorRegistryFactory;
1013
use PHPStan\DependencyInjection\Type\LazyDynamicThrowTypeExtensionProvider;
1114
use PHPStan\DependencyInjection\Type\LazyParameterClosureTypeExtensionProvider;
1215
use PHPStan\DependencyInjection\Type\LazyParameterOutTypeExtensionProvider;
16+
use PHPStan\Diagnose\DiagnoseExtension;
17+
use PHPStan\Parser\RichParser;
1318
use PHPStan\PhpDoc\StubFilesExtension;
1419
use PHPStan\PhpDoc\TypeNodeResolverExtension;
1520
use PHPStan\Reflection\AllowedSubTypesClassReflectionExtension;
@@ -101,7 +106,9 @@ public function loadConfiguration(): void
101106
RestrictedFunctionUsageExtension::class => RestrictedFunctionUsageExtension::FUNCTION_EXTENSION_TAG,
102107
RestrictedPropertyUsageExtension::class => RestrictedPropertyUsageExtension::PROPERTY_EXTENSION_TAG,
103108
RestrictedClassConstantUsageExtension::class => RestrictedClassConstantUsageExtension::CLASS_CONSTANT_EXTENSION_TAG,
104-
109+
NodeVisitor::class => RichParser::VISITOR_SERVICE_TAG,
110+
Collector::class => CollectorRegistryFactory::COLLECTOR_TAG,
111+
DiagnoseExtension::class => DiagnoseExtension::EXTENSION_TAG,
105112
];
106113

107114
foreach ($autowiredServiceClasses as $class) {

src/Parser/LastConditionVisitor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
use PhpParser\Node;
66
use PhpParser\NodeVisitorAbstract;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use function count;
89

10+
#[AutowiredService]
911
final class LastConditionVisitor extends NodeVisitorAbstract
1012
{
1113

src/Reflection/BetterReflection/SourceLocator/CachingVisitor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
use PHPStan\BetterReflection\Reflection\Exception\InvalidConstantNode;
1010
use PHPStan\BetterReflection\SourceLocator\Located\LocatedSource;
1111
use PHPStan\BetterReflection\Util\ConstantNodeChecker;
12-
use PHPStan\DependencyInjection\AutowiredService;
1312
use PHPStan\Reflection\ConstantNameHelper;
1413
use function strtolower;
1514

16-
#[AutowiredService]
1715
final class CachingVisitor extends NodeVisitorAbstract
1816
{
1917

0 commit comments

Comments
 (0)