Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
-
name: 'Active Classes'
run: |
vendor/bin/class-leak check bin config src rules utils --skip-suffix "Rector" --skip-type="Rector\\Utils\\Compiler\\Unprefixer" --skip-type="Rector\\NodeCollector\\BinaryOpConditionsCollector" --skip-type="Rector\\Set\\Contract\\SetListInterface" --skip-type="Rector\\DependencyInjection\\PHPStan\\RichParserFactory" --skip-type="Rector\\Utils\\PHPStan\\Tests\\Rule\\SingleServiceRegistrationRule\\Source\\DuplicateRegistrationFactory" --skip-type="Rector\\Utils\\PHPStan\\Tests\\Rule\\SingleServiceRegistrationRule\\Source\\SingleRegistrationFactory"
vendor/bin/class-leak check bin config src rules utils --skip-suffix "Rector" --skip-type="Rector\\Utils\\Compiler\\Unprefixer" --skip-type="Rector\\NodeCollector\\BinaryOpConditionsCollector" --skip-type="Rector\\Set\\Contract\\SetListInterface" --skip-type="Rector\\DependencyInjection\\PHPStan\\RichParserFactory" --skip-type="Rector\\Utils\\PHPStan\\Tests\\Rule\\SingleServiceRegistrationRule\\Source\\DuplicateRegistrationFactory" --skip-type="Rector\\Utils\\PHPStan\\Tests\\Rule\\SingleServiceRegistrationRule\\Source\\SingleRegistrationFactory" --skip-type="Rector\\ChangesReporting\\Contract\\Output\\OutputFormatterInterface" --skip-type="Rector\\NodeTypeResolver\\Contract\\NodeTypeResolverInterface" --skip-type="Rector\\CodingStyle\\Contract\\ClassNameImport\\ClassNameImportSkipVoterInterface" --skip-type="Rector\\Php80\\Contract\\ConverterAttributeDecoratorInterface"

-
name: 'Compatible PHPStan versions'
Expand Down
94 changes: 4 additions & 90 deletions src/DependencyInjection/LazyContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@
use Rector\BetterPhpDocParser\PhpDocParser\StaticDoctrineAnnotationParser\PlainValueParser;
use Rector\Caching\Cache;
use Rector\Caching\CacheFactory;
use Rector\ChangesReporting\Contract\Output\OutputFormatterInterface;
use Rector\ChangesReporting\Output\ConsoleOutputFormatter;
use Rector\ChangesReporting\Output\GitHubOutputFormatter;
use Rector\ChangesReporting\Output\GitlabOutputFormatter;
use Rector\ChangesReporting\Output\JsonOutputFormatter;
use Rector\CodingStyle\ClassNameImport\ClassNameImportSkipVoter\AliasClassNameImportSkipVoter;
use Rector\CodingStyle\ClassNameImport\ClassNameImportSkipVoter\ClassLikeNameClassNameImportSkipVoter;
use Rector\CodingStyle\ClassNameImport\ClassNameImportSkipVoter\FullyQualifiedNameClassNameImportSkipVoter;
use Rector\CodingStyle\ClassNameImport\ClassNameImportSkipVoter\OriginalNameImportSkipVoter;
use Rector\CodingStyle\ClassNameImport\ClassNameImportSkipVoter\ReservedClassNameImportSkipVoter;
use Rector\CodingStyle\ClassNameImport\ClassNameImportSkipVoter\ShortClassImportSkipVoter;
use Rector\CodingStyle\ClassNameImport\ClassNameImportSkipVoter\UsesClassNameImportSkipVoter;
use Rector\CodingStyle\Contract\ClassNameImport\ClassNameImportSkipVoterInterface;
use Rector\Config\RectorConfig;
use Rector\Configuration\ConfigurationRuleFilter;
use Rector\Configuration\RenamedClassesDataCollector;
Expand All @@ -72,25 +59,9 @@
use Rector\NodeNameResolver\NodeNameResolver\PropertyNameResolver;
use Rector\NodeNameResolver\NodeNameResolver\UseNameResolver;
use Rector\NodeNameResolver\NodeNameResolver\VariableNameResolver;
use Rector\NodeTypeResolver\Contract\NodeTypeResolverInterface;
use Rector\NodeTypeResolver\DependencyInjection\PHPStanServicesFactory;
use Rector\NodeTypeResolver\NodeTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\CastTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\ClassAndInterfaceTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\ClassConstFetchTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\IdentifierTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\NameTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\NewTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\ParamTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\PropertyFetchTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\PropertyTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\ScalarTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\StaticCallMethodCallTypeResolver;
use Rector\NodeTypeResolver\NodeTypeResolver\TraitTypeResolver;
use Rector\NodeTypeResolver\Reflection\BetterReflection\SourceLocatorProvider\DynamicSourceLocatorProvider;
use Rector\Php80\AttributeDecorator\DoctrineConverterAttributeDecorator;
use Rector\Php80\AttributeDecorator\SensioParamConverterAttributeDecorator;
use Rector\Php80\Contract\ConverterAttributeDecoratorInterface;
use Rector\PhpAttribute\AnnotationToAttributeMapper;
use Rector\PhpAttribute\AnnotationToAttributeMapper\ArrayAnnotationToAttributeMapper;
use Rector\PhpAttribute\AnnotationToAttributeMapper\ArrayItemNodeAnnotationToAttributeMapper;
Expand Down Expand Up @@ -246,19 +217,6 @@ final class LazyContainerFactory
UnionPhpDocTypeMapper::class,
];

/**
* @var array<class-string<ClassNameImportSkipVoterInterface>>
*/
private const array CLASS_NAME_IMPORT_SKIPPER_CLASSES = [
AliasClassNameImportSkipVoter::class,
ClassLikeNameClassNameImportSkipVoter::class,
FullyQualifiedNameClassNameImportSkipVoter::class,
UsesClassNameImportSkipVoter::class,
ReservedClassNameImportSkipVoter::class,
ShortClassImportSkipVoter::class,
OriginalNameImportSkipVoter::class,
];

/**
* @var array<class-string<TypeMapperInterface>>
*/
Expand Down Expand Up @@ -315,34 +273,6 @@ final class LazyContainerFactory
PhpVersionFactory::class,
];

/**
* @var array<class-string<OutputFormatterInterface>>
*/
private const array OUTPUT_FORMATTER_CLASSES = [
ConsoleOutputFormatter::class,
JsonOutputFormatter::class,
GitlabOutputFormatter::class,
GitHubOutputFormatter::class,
];

/**
* @var array<class-string<NodeTypeResolverInterface>>
*/
private const array NODE_TYPE_RESOLVER_CLASSES = [
CastTypeResolver::class,
StaticCallMethodCallTypeResolver::class,
ClassAndInterfaceTypeResolver::class,
IdentifierTypeResolver::class,
NameTypeResolver::class,
NewTypeResolver::class,
ParamTypeResolver::class,
PropertyFetchTypeResolver::class,
ClassConstFetchTypeResolver::class,
PropertyTypeResolver::class,
ScalarTypeResolver::class,
TraitTypeResolver::class,
];

/**
* @var array<class-string<PhpParserNodeMapperInterface>>
*/
Expand All @@ -357,14 +287,6 @@ final class LazyContainerFactory
ExprNodeMapper::class,
];

/**
* @var array<class-string<ConverterAttributeDecoratorInterface>>
*/
private const array CONVERTER_ATTRIBUTE_DECORATOR_CLASSES = [
SensioParamConverterAttributeDecorator::class,
DoctrineConverterAttributeDecorator::class,
];

/**
* @api used as next rectorConfig factory
*/
Expand Down Expand Up @@ -488,11 +410,7 @@ static function (UnionTypeMapper $unionTypeMapper) use ($rectorConfig): void {
private function registerNodeNameResolvers(RectorConfig $rectorConfig): void
{
// node name resolvers
$this->registerTagged(
$rectorConfig,
self::CONVERTER_ATTRIBUTE_DECORATOR_CLASSES,
ConverterAttributeDecoratorInterface::class
);
$rectorConfig->autodiscover(__DIR__ . '/../../rules/Php80/AttributeDecorator');
}

private function registerRectorAutowiring(RectorConfig $rectorConfig): void
Expand Down Expand Up @@ -546,13 +464,9 @@ private function registerTaggedServices(RectorConfig $rectorConfig): void
$this->registerTagged($rectorConfig, self::TYPE_MAPPER_CLASSES, TypeMapperInterface::class);
$this->registerTagged($rectorConfig, self::PHPDOC_TYPE_MAPPER_CLASSES, PhpDocTypeMapperInterface::class);
$this->registerTagged($rectorConfig, self::NODE_NAME_RESOLVER_CLASSES, NodeNameResolverInterface::class);
$this->registerTagged($rectorConfig, self::NODE_TYPE_RESOLVER_CLASSES, NodeTypeResolverInterface::class);
$this->registerTagged($rectorConfig, self::OUTPUT_FORMATTER_CLASSES, OutputFormatterInterface::class);
$this->registerTagged(
$rectorConfig,
self::CLASS_NAME_IMPORT_SKIPPER_CLASSES,
ClassNameImportSkipVoterInterface::class
);
$rectorConfig->autodiscover(__DIR__ . '/../NodeTypeResolver/NodeTypeResolver');
$rectorConfig->autodiscover(__DIR__ . '/../ChangesReporting/Output');
$rectorConfig->autodiscover(__DIR__ . '/../../rules/CodingStyle/ClassNameImport/ClassNameImportSkipVoter');

$rectorConfig->singleton(
SymfonyStyle::class,
Expand Down
Loading