Skip to content

Commit

Permalink
Various cleanup (#4121)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jun 8, 2023
1 parent 754f2b3 commit bf2fe78
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 119 deletions.
14 changes: 13 additions & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
use Rector\PhpDocParser\NodeTraverser\SimpleCallableNodeTraverser;
use Rector\PhpDocParser\PhpParser\SmartPhpParser;
use Rector\PhpDocParser\PhpParser\SmartPhpParserFactory;
use Rector\RectorGenerator\Command\GenerateCommand;
use Rector\RectorGenerator\Command\InitRecipeCommand;
use Rector\Utils\Command\MissingInSetCommand;
use Rector\Utils\Command\OutsideAnySetCommand;
use Symfony\Component\Console\Application;
Expand Down Expand Up @@ -95,6 +97,7 @@
__DIR__ . '/../packages/PHPStanStaticTypeMapper/Enum',
__DIR__ . '/../packages/Caching/Cache.php',
__DIR__ . '/../packages/NodeTypeResolver/PhpDocNodeVisitor/UnderscoreRenamePhpDocNodeVisitor.php',
__DIR__ . '/../packages/NodeTypeResolver/PHPStan/ObjectWithoutClassTypeWithParentTypes.php',

// used in PHPStan
__DIR__ . '/../packages/NodeTypeResolver/Reflection/BetterReflection/RectorBetterReflectionSourceLocatorFactory.php',
Expand Down Expand Up @@ -211,11 +214,20 @@
$services->set(MissingInSetCommand::class);
$services->set(OutsideAnySetCommand::class);

$services->set(ConsoleApplication::class)
$services->get(ConsoleApplication::class)
->call('add', [service(MissingInSetCommand::class)])
->call('add', [service(OutsideAnySetCommand::class)]);
}

if (class_exists(InitRecipeCommand::class)) {
$services->set(InitRecipeCommand::class);
$services->set(GenerateCommand::class);

$services->get(ConsoleApplication::class)
->call('add', [service(InitRecipeCommand::class)])
->call('add', [service(GenerateCommand::class)]);
}

// phpdoc parser
$services->set(SmartPhpParser::class)
->factory([service(SmartPhpParserFactory::class), 'create']);
Expand Down
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -715,3 +715,5 @@ parameters:

# handle later
- '#Fetching class constant class of deprecated class Rector\\(.*?)#'

- '#Function "class_exists\(\)" cannot be used/left in the code\: use ReflectionProvider\->has\*\(\) instead#'

This file was deleted.

This file was deleted.

This file was deleted.

40 changes: 0 additions & 40 deletions rules/Php80/AttributeDecorator/JMSAccessTypeAttributeDecorator.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@

use PhpParser\Node\AttributeGroup;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\Php80\AttributeDecorator\SensioParamConverterAttributeDecorator;
use Rector\Php80\Contract\AttributeDecoratorInterface;

final class AttributeGroupNamedArgumentManipulator
{
/**
* @param AttributeDecoratorInterface[] $attributeDecorators
* @var AttributeDecoratorInterface[]
*/
public function __construct(
private readonly array $attributeDecorators
) {
private array $attributeDecorators = [];

public function __construct(SensioParamConverterAttributeDecorator $sensioParamConverterAttributeDecorator)
{
$this->attributeDecorators[] = $sensioParamConverterAttributeDecorator;
}

/**
Expand Down

0 comments on commit bf2fe78

Please sign in to comment.