Skip to content

More service converted to #[AutowiredService] attribute usage #4024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 0 additions & 143 deletions conf/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ services:
-
class: PhpParser\BuilderFactory

-
class: PHPStan\Parser\LexerFactory

-
class: PhpParser\NodeVisitor\NameResolver
arguments:
Expand Down Expand Up @@ -384,25 +381,10 @@ services:
-
class: PHPStan\PhpDocParser\Printer\Printer

-
class: PHPStan\PhpDoc\PhpDocStringResolver

-
class: PHPStan\PhpDoc\ConstExprNodeResolver

-
class: PHPStan\PhpDoc\TypeNodeResolver

-
class: PHPStan\PhpDoc\TypeNodeResolverExtensionRegistryProvider
factory: PHPStan\PhpDoc\LazyTypeNodeResolverExtensionRegistryProvider

-
class: PHPStan\PhpDoc\TypeStringResolver

-
class: PHPStan\PhpDoc\StubValidator

-
class: PHPStan\PhpDoc\DefaultStubFilesProvider
arguments:
Expand All @@ -411,21 +393,6 @@ services:
autowired:
- PHPStan\PhpDoc\StubFilesProvider

-
class: PHPStan\PhpDoc\JsonValidateStubFilesExtension
tags:
- phpstan.stubFilesExtension

-
class: PHPStan\PhpDoc\ReflectionClassStubFilesExtension
tags:
- phpstan.stubFilesExtension

-
class: PHPStan\PhpDoc\ReflectionEnumStubFilesExtension
tags:
- phpstan.stubFilesExtension

-
class: PHPStan\Analyser\Analyser
arguments:
Expand All @@ -441,32 +408,17 @@ services:
arguments:
parser: @defaultAnalysisParser

-
class: PHPStan\Analyser\IgnoreErrorExtensionProvider

-
class: PHPStan\Analyser\LocalIgnoresProcessor

-
class: PHPStan\Analyser\RuleErrorTransformer

-
class: PHPStan\Analyser\Ignore\IgnoredErrorHelper
arguments:
ignoreErrors: %ignoreErrors%
reportUnmatchedIgnoredErrors: %reportUnmatchedIgnoredErrors%

-
class: PHPStan\Analyser\Ignore\IgnoreLexer

-
class: PHPStan\Analyser\LazyInternalScopeFactory
autowired:
- PHPStan\Analyser\InternalScopeFactory

-
class: PHPStan\Analyser\ScopeFactory

-
class: PHPStan\Analyser\NodeScopeResolver
arguments:
Expand All @@ -486,9 +438,6 @@ services:
class: PHPStan\Analyser\ConstantResolver
factory: @PHPStan\Analyser\ConstantResolverFactory::create()

-
class: PHPStan\Analyser\ConstantResolverFactory

-
implement: PHPStan\Analyser\ResultCache\ResultCacheManagerFactory
arguments:
Expand All @@ -511,9 +460,6 @@ services:
arguments:
cacheFilePath: %resultCachePath%

-
class: PHPStan\Analyser\RicherScopeGetTypeHelper

-
class: PHPStan\Cache\Cache
arguments:
Expand All @@ -523,15 +469,6 @@ services:
class: PHPStan\Collectors\Registry
factory: @PHPStan\Collectors\RegistryFactory::create

-
class: PHPStan\Collectors\RegistryFactory

-
class: PHPStan\Command\AnalyseApplication

-
class: PHPStan\Command\AnalyserRunner

-
class: PHPStan\Command\FixerApplication
arguments:
Expand All @@ -551,12 +488,6 @@ services:
arguments:
parser: @defaultAnalysisParser

-
class: PHPStan\Dependency\ExportedNodeResolver

-
class: PHPStan\Dependency\ExportedNodeVisitor

-
class: PHPStan\DependencyInjection\Container
factory: PHPStan\DependencyInjection\MemoizingContainer
Expand Down Expand Up @@ -684,12 +615,6 @@ services:
tags:
- phpstan.diagnoseExtension

-
class: PHPStan\Process\CpuCoreCounter

-
class: PHPStan\Reflection\AttributeReflectionFactory

-
implement: PHPStan\Reflection\FunctionReflectionFactory
arguments:
Expand All @@ -706,34 +631,22 @@ services:
-
class: PHPStan\Reflection\Annotations\AnnotationsPropertiesClassReflectionExtension

-
class: PHPStan\Reflection\BetterReflection\SourceLocator\CachingVisitor

-
class: PHPStan\Reflection\BetterReflection\SourceLocator\FileNodesFetcher
arguments:
parser: @defaultAnalysisParser

-
class: PHPStan\Reflection\BetterReflection\SourceLocator\ComposerJsonAndInstalledJsonSourceLocatorMaker

-
class: PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedDirectorySourceLocatorFactory
arguments:
fileFinder: @fileFinderScan

-
class: PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedDirectorySourceLocatorRepository

-
implement: PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedPsrAutoloaderLocatorFactory

-
implement: PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedSingleFileSourceLocatorFactory

-
class: PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedSingleFileSourceLocatorRepository

-
class: PHPStan\Reflection\BetterReflection\Type\AdapterReflectionEnumCaseDynamicReturnTypeExtension
arguments:
Expand Down Expand Up @@ -946,37 +859,17 @@ services:
checkClassCaseSensitivity: %checkClassCaseSensitivity%
checkThisOnly: %checkThisOnly%

-
class: PHPStan\Rules\FunctionReturnTypeCheck
-
class: PHPStan\Rules\ParameterCastableToStringCheck

-
class: PHPStan\Rules\Generics\CrossCheckInterfacesHelper

-
class: PHPStan\Rules\Generics\GenericAncestorsCheck
arguments:
skipCheckGenericClasses: %featureToggles.skipCheckGenericClasses%
checkMissingTypehints: %checkMissingTypehints%

-
class: PHPStan\Rules\Generics\GenericObjectTypeCheck

-
class: PHPStan\Rules\Generics\MethodTagTemplateTypeCheck

-
class: PHPStan\Rules\Generics\TemplateTypeCheck
arguments:
checkClassCaseSensitivity: %checkClassCaseSensitivity%

-
class: PHPStan\Rules\Generics\VarianceCheck

-
class: PHPStan\Rules\InternalTag\RestrictedInternalUsageHelper

-
class: PHPStan\Rules\IssetCheck
arguments:
Expand All @@ -1003,54 +896,24 @@ services:
reportMaybes: %reportMaybesInMethodSignatures%
reportStatic: %reportStaticMethodSignatures%

-
class: PHPStan\Rules\Methods\MethodParameterComparisonHelper

-
class: PHPStan\Rules\Methods\MethodVisibilityComparisonHelper

-
class: PHPStan\Rules\MissingTypehintCheck
arguments:
checkMissingCallableSignature: %checkMissingCallableSignature%
skipCheckGenericClasses: %featureToggles.skipCheckGenericClasses%

-
class: PHPStan\Rules\NullsafeCheck

-
class: PHPStan\Rules\Constants\LazyAlwaysUsedClassConstantsExtensionProvider

-
class: PHPStan\Rules\Methods\LazyAlwaysUsedMethodExtensionProvider

-
class: PHPStan\Rules\PhpDoc\ConditionalReturnTypeRuleHelper

-
class: PHPStan\Rules\PhpDoc\AssertRuleHelper
arguments:
checkMissingTypehints: %checkMissingTypehints%
checkClassCaseSensitivity: %checkClassCaseSensitivity%

-
class: PHPStan\Rules\PhpDoc\UnresolvableTypeHelper

-
class: PHPStan\Rules\PhpDoc\GenericCallableRuleHelper

-
class: PHPStan\Rules\PhpDoc\IncompatiblePhpDocTypeCheck

-
class: PHPStan\Rules\PhpDoc\VarTagTypeRuleHelper
arguments:
checkTypeAgainstPhpDocType: %reportWrongPhpDocTypeInVarTag%
strictWideningCheck: %reportAnyTypeWideningInVarTag%

-
class: PHPStan\Rules\Playground\NeverRuleHelper

-
class: PHPStan\Rules\Properties\AccessPropertiesCheck
arguments:
Expand All @@ -1060,12 +923,6 @@ services:
-
class: PHPStan\Rules\Properties\UninitializedPropertyRule

-
class: PHPStan\Rules\Properties\LazyReadWritePropertiesExtensionProvider

-
class: PHPStan\Rules\Properties\PropertyDescriptor

-
class: PHPStan\Rules\RuleLevelHelper
arguments:
Expand Down
2 changes: 2 additions & 0 deletions src/Analyser/ConstantResolverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

namespace PHPStan\Analyser;

use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\DependencyInjection\Container;
use PHPStan\Php\ComposerPhpVersionFactory;
use PHPStan\Reflection\ReflectionProvider\ReflectionProviderProvider;

#[AutowiredService]
final class ConstantResolverFactory
{

Expand Down
2 changes: 2 additions & 0 deletions src/Analyser/Ignore/IgnoreLexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

use Nette\Utils\Strings;
use PHPStan\Analyser\Error;
use PHPStan\DependencyInjection\AutowiredService;
use function implode;
use const PREG_SET_ORDER;

#[AutowiredService]
final class IgnoreLexer
{

Expand Down
2 changes: 2 additions & 0 deletions src/Analyser/IgnoreErrorExtensionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

namespace PHPStan\Analyser;

use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\DependencyInjection\Container;

#[AutowiredService]
final class IgnoreErrorExtensionProvider
{

Expand Down
2 changes: 2 additions & 0 deletions src/Analyser/LocalIgnoresProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace PHPStan\Analyser;

use PHPStan\DependencyInjection\AutowiredService;
use function array_key_exists;
use function array_values;
use function count;
Expand All @@ -10,6 +11,7 @@
/**
* @phpstan-import-type LinesToIgnore from FileAnalyserResult
*/
#[AutowiredService]
final class LocalIgnoresProcessor
{

Expand Down
2 changes: 2 additions & 0 deletions src/Analyser/RicherScopeGetTypeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
use PhpParser\Node;
use PhpParser\Node\Expr\BinaryOp\Identical;
use PhpParser\Node\Expr\Variable;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Reflection\InitializerExprTypeResolver;
use PHPStan\Type\BooleanType;
use PHPStan\Type\Constant\ConstantBooleanType;
use PHPStan\Type\TypeResult;
use function is_string;

#[AutowiredService]
final class RicherScopeGetTypeHelper
{

Expand Down
2 changes: 2 additions & 0 deletions src/Analyser/RuleErrorTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace PHPStan\Analyser;

use PhpParser\Node;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Rules\FileRuleError;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\LineRuleError;
Expand All @@ -11,6 +12,7 @@
use PHPStan\Rules\RuleError;
use PHPStan\Rules\TipRuleError;

#[AutowiredService]
final class RuleErrorTransformer
{

Expand Down
3 changes: 3 additions & 0 deletions src/Analyser/ScopeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

namespace PHPStan\Analyser;

use PHPStan\DependencyInjection\AutowiredService;

/**
* @api
*/
#[AutowiredService]
final class ScopeFactory
{

Expand Down
Loading
Loading