mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-13 14:42:23 +00:00
[Rectify] [Php81] Enable Rectify on Readonly Property only (#1384)
* re-enable rectify and ecs * [Rectify] [Php81] Enable Rectify on Readonly Property only * comment * [ci-review] Rector Rectify * [ci-review] Rector Rectify * [ci-review] Rector Rectify * [ci-review] Rector Rectify * [ci-review] Rector Rectify Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
parent
8547bdba9d
commit
fc10fce13d
5
.github/workflows/rector.yaml
vendored
5
.github/workflows/rector.yaml
vendored
|
@ -57,10 +57,9 @@ jobs:
|
||||||
- run: composer install --no-progress --ansi
|
- run: composer install --no-progress --ansi
|
||||||
|
|
||||||
## First run Rector - here can't be --dry-run !!! it would stop the job with it and not commit anything in the future
|
## First run Rector - here can't be --dry-run !!! it would stop the job with it and not commit anything in the future
|
||||||
# temporary disable rectify as splitted from https://github.com/rectorphp/rector-src/pull/1364
|
- run: bin/rector process ${{ matrix.paths }} --ansi --no-progress-bar
|
||||||
# - run: bin/rector process ${{ matrix.paths }} --ansi --no-progress-bar
|
|
||||||
|
|
||||||
# - run: vendor/bin/ecs check --fix --ansi
|
- run: vendor/bin/ecs check --fix --ansi
|
||||||
|
|
||||||
# see https://github.com/EndBug/add-and-commit
|
# see https://github.com/EndBug/add-and-commit
|
||||||
-
|
-
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser;
|
||||||
final class CommentsMerger
|
final class CommentsMerger
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private SimpleCallableNodeTraverser $simpleCallableNodeTraverser
|
private readonly SimpleCallableNodeTraverser $simpleCallableNodeTraverser
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,19 +49,19 @@ final class PhpDocInfo
|
||||||
|
|
||||||
private bool $isSingleLine = false;
|
private bool $isSingleLine = false;
|
||||||
|
|
||||||
private PhpDocNode $originalPhpDocNode;
|
private readonly PhpDocNode $originalPhpDocNode;
|
||||||
|
|
||||||
private bool $hasChanged = false;
|
private bool $hasChanged = false;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private PhpDocNode $phpDocNode,
|
private readonly PhpDocNode $phpDocNode,
|
||||||
private BetterTokenIterator $betterTokenIterator,
|
private readonly BetterTokenIterator $betterTokenIterator,
|
||||||
private StaticTypeMapper $staticTypeMapper,
|
private readonly StaticTypeMapper $staticTypeMapper,
|
||||||
private \PhpParser\Node $node,
|
private readonly \PhpParser\Node $node,
|
||||||
private AnnotationNaming $annotationNaming,
|
private readonly AnnotationNaming $annotationNaming,
|
||||||
private CurrentNodeProvider $currentNodeProvider,
|
private readonly CurrentNodeProvider $currentNodeProvider,
|
||||||
private RectorChangeCollector $rectorChangeCollector,
|
private readonly RectorChangeCollector $rectorChangeCollector,
|
||||||
private PhpDocNodeByTypeFinder $phpDocNodeByTypeFinder
|
private readonly PhpDocNodeByTypeFinder $phpDocNodeByTypeFinder
|
||||||
) {
|
) {
|
||||||
$this->originalPhpDocNode = clone $phpDocNode;
|
$this->originalPhpDocNode = clone $phpDocNode;
|
||||||
|
|
||||||
|
|
|
@ -28,14 +28,14 @@ final class PhpDocInfoFactory
|
||||||
private array $phpDocInfosByObjectHash = [];
|
private array $phpDocInfosByObjectHash = [];
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private PhpDocNodeMapper $phpDocNodeMapper,
|
private readonly PhpDocNodeMapper $phpDocNodeMapper,
|
||||||
private CurrentNodeProvider $currentNodeProvider,
|
private readonly CurrentNodeProvider $currentNodeProvider,
|
||||||
private Lexer $lexer,
|
private readonly Lexer $lexer,
|
||||||
private BetterPhpDocParser $betterPhpDocParser,
|
private readonly BetterPhpDocParser $betterPhpDocParser,
|
||||||
private StaticTypeMapper $staticTypeMapper,
|
private readonly StaticTypeMapper $staticTypeMapper,
|
||||||
private AnnotationNaming $annotationNaming,
|
private readonly AnnotationNaming $annotationNaming,
|
||||||
private RectorChangeCollector $rectorChangeCollector,
|
private readonly RectorChangeCollector $rectorChangeCollector,
|
||||||
private PhpDocNodeByTypeFinder $phpDocNodeByTypeFinder
|
private readonly PhpDocNodeByTypeFinder $phpDocNodeByTypeFinder
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@ final class TokenIteratorFactory
|
||||||
private const INDEX = 'index';
|
private const INDEX = 'index';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private Lexer $lexer,
|
private readonly Lexer $lexer,
|
||||||
private PrivatesAccessor $privatesAccessor
|
private readonly PrivatesAccessor $privatesAccessor
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNod
|
||||||
final class PhpDocClassRenamer
|
final class PhpDocClassRenamer
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ClassAnnotationMatcher $classAnnotationMatcher
|
private readonly ClassAnnotationMatcher $classAnnotationMatcher
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,10 @@ use Rector\TypeDeclaration\PhpDocParser\ParamPhpDocNodeFactory;
|
||||||
final class PhpDocTypeChanger
|
final class PhpDocTypeChanger
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private StaticTypeMapper $staticTypeMapper,
|
private readonly StaticTypeMapper $staticTypeMapper,
|
||||||
private TypeComparator $typeComparator,
|
private readonly TypeComparator $typeComparator,
|
||||||
private ParamPhpDocNodeFactory $paramPhpDocNodeFactory,
|
private readonly ParamPhpDocNodeFactory $paramPhpDocNodeFactory,
|
||||||
private NodeNameResolver $nodeNameResolver
|
private readonly NodeNameResolver $nodeNameResolver
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ use Rector\Naming\ValueObject\ParamRename;
|
||||||
final class PropertyDocBlockManipulator
|
final class PropertyDocBlockManipulator
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private PhpDocInfoFactory $phpDocInfoFactory
|
private readonly PhpDocInfoFactory $phpDocInfoFactory
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,8 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||||
final class VarAnnotationManipulator
|
final class VarAnnotationManipulator
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private PhpDocInfoFactory $phpDocInfoFactory,
|
private readonly PhpDocInfoFactory $phpDocInfoFactory,
|
||||||
private PhpDocTypeChanger $phpDocTypeChanger
|
private readonly PhpDocTypeChanger $phpDocTypeChanger
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,10 @@ final class PhpDocNodeMapper
|
||||||
* @param BasePhpDocNodeVisitorInterface[] $phpDocNodeVisitors
|
* @param BasePhpDocNodeVisitorInterface[] $phpDocNodeVisitors
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
private readonly CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
||||||
private ParentConnectingPhpDocNodeVisitor $parentConnectingPhpDocNodeVisitor,
|
private readonly ParentConnectingPhpDocNodeVisitor $parentConnectingPhpDocNodeVisitor,
|
||||||
private CloningPhpDocNodeVisitor $cloningPhpDocNodeVisitor,
|
private readonly CloningPhpDocNodeVisitor $cloningPhpDocNodeVisitor,
|
||||||
private array $phpDocNodeVisitors
|
private readonly array $phpDocNodeVisitors
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ use Symplify\SimplePhpDocParser\PhpDocNodeTraverser;
|
||||||
final class ChangedPhpDocNodeTraverserFactory
|
final class ChangedPhpDocNodeTraverserFactory
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ChangedPhpDocNodeVisitor $changedPhpDocNodeVisitor
|
private readonly ChangedPhpDocNodeVisitor $changedPhpDocNodeVisitor
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use Symplify\SimplePhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor;
|
||||||
final class ArrayTypePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
final class ArrayTypePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private AttributeMirrorer $attributeMirrorer
|
private readonly AttributeMirrorer $attributeMirrorer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use Symplify\SimplePhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor;
|
||||||
final class CallableTypePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
final class CallableTypePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private AttributeMirrorer $attributeMirrorer
|
private readonly AttributeMirrorer $attributeMirrorer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use Symplify\SimplePhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor;
|
||||||
final class IntersectionTypeNodePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
final class IntersectionTypeNodePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private AttributeMirrorer $attributeMirrorer
|
private readonly AttributeMirrorer $attributeMirrorer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use Symplify\SimplePhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor;
|
||||||
final class ParamPhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
final class ParamPhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private AttributeMirrorer $attributeMirrorer
|
private readonly AttributeMirrorer $attributeMirrorer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ use Symplify\SimplePhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor;
|
||||||
final class TemplatePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
final class TemplatePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
private readonly CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
||||||
private AttributeMirrorer $attributeMirrorer
|
private readonly AttributeMirrorer $attributeMirrorer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ use Symplify\SimplePhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor;
|
||||||
final class UnionTypeNodePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
final class UnionTypeNodePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
private readonly CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
||||||
private AttributeMirrorer $attributeMirrorer
|
private readonly AttributeMirrorer $attributeMirrorer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,13 @@ use Symplify\PackageBuilder\Reflection\PrivatesCaller;
|
||||||
*/
|
*/
|
||||||
final class BetterPhpDocParser extends PhpDocParser
|
final class BetterPhpDocParser extends PhpDocParser
|
||||||
{
|
{
|
||||||
private PrivatesCaller $privatesCaller;
|
private readonly PrivatesCaller $privatesCaller;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TypeParser $typeParser,
|
TypeParser $typeParser,
|
||||||
ConstExprParser $constExprParser,
|
ConstExprParser $constExprParser,
|
||||||
private TokenIteratorFactory $tokenIteratorFactory,
|
private readonly TokenIteratorFactory $tokenIteratorFactory,
|
||||||
private DoctrineAnnotationDecorator $doctrineAnnotationDecorator
|
private readonly DoctrineAnnotationDecorator $doctrineAnnotationDecorator
|
||||||
) {
|
) {
|
||||||
parent::__construct($typeParser, $constExprParser);
|
parent::__construct($typeParser, $constExprParser);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ use Rector\BetterPhpDocParser\ValueObject\StartAndEnd;
|
||||||
final class BetterTypeParser extends TypeParser
|
final class BetterTypeParser extends TypeParser
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private TokenIteratorFactory $tokenIteratorFactory,
|
private readonly TokenIteratorFactory $tokenIteratorFactory,
|
||||||
?ConstExprParser $constExprParser = null
|
?ConstExprParser $constExprParser = null
|
||||||
) {
|
) {
|
||||||
parent::__construct($constExprParser);
|
parent::__construct($constExprParser);
|
||||||
|
|
|
@ -22,8 +22,8 @@ final class ClassAnnotationMatcher
|
||||||
private array $fullyQualifiedNameByHash = [];
|
private array $fullyQualifiedNameByHash = [];
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private UseImportNameMatcher $useImportNameMatcher,
|
private readonly UseImportNameMatcher $useImportNameMatcher,
|
||||||
private ReflectionProvider $reflectionProvider
|
private readonly ReflectionProvider $reflectionProvider
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,11 +45,11 @@ final class DoctrineAnnotationDecorator
|
||||||
private const NESTED_ANNOTATION_END_REGEX = '#(\s+)?\}\)(\s+)?#';
|
private const NESTED_ANNOTATION_END_REGEX = '#(\s+)?\}\)(\s+)?#';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private CurrentNodeProvider $currentNodeProvider,
|
private readonly CurrentNodeProvider $currentNodeProvider,
|
||||||
private ClassAnnotationMatcher $classAnnotationMatcher,
|
private readonly ClassAnnotationMatcher $classAnnotationMatcher,
|
||||||
private StaticDoctrineAnnotationParser $staticDoctrineAnnotationParser,
|
private readonly StaticDoctrineAnnotationParser $staticDoctrineAnnotationParser,
|
||||||
private TokenIteratorFactory $tokenIteratorFactory,
|
private readonly TokenIteratorFactory $tokenIteratorFactory,
|
||||||
private AttributeMirrorer $attributeMirrorer
|
private readonly AttributeMirrorer $attributeMirrorer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,11 @@ use Rector\StaticTypeMapper\StaticTypeMapper;
|
||||||
final class PhpDocFromTypeDeclarationDecorator
|
final class PhpDocFromTypeDeclarationDecorator
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private StaticTypeMapper $staticTypeMapper,
|
private readonly StaticTypeMapper $staticTypeMapper,
|
||||||
private PhpDocInfoFactory $phpDocInfoFactory,
|
private readonly PhpDocInfoFactory $phpDocInfoFactory,
|
||||||
private NodeNameResolver $nodeNameResolver,
|
private readonly NodeNameResolver $nodeNameResolver,
|
||||||
private PhpDocTypeChanger $phpDocTypeChanger,
|
private readonly PhpDocTypeChanger $phpDocTypeChanger,
|
||||||
private TypeUnwrapper $typeUnwrapper
|
private readonly TypeUnwrapper $typeUnwrapper
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNod
|
||||||
final class StaticDoctrineAnnotationParser
|
final class StaticDoctrineAnnotationParser
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private PlainValueParser $plainValueParser,
|
private readonly PlainValueParser $plainValueParser,
|
||||||
private ArrayParser $arrayParser
|
private readonly ArrayParser $arrayParser
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use Rector\BetterPhpDocParser\ValueObject\Parser\BetterTokenIterator;
|
||||||
final class ArrayParser
|
final class ArrayParser
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private PlainValueParser $plainValueParser
|
private readonly PlainValueParser $plainValueParser
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ final class PlainValueParser
|
||||||
private ArrayParser $arrayParser;
|
private ArrayParser $arrayParser;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ClassAnnotationMatcher $classAnnotationMatcher,
|
private readonly ClassAnnotationMatcher $classAnnotationMatcher,
|
||||||
private CurrentNodeProvider $currentNodeProvider
|
private readonly CurrentNodeProvider $currentNodeProvider
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,13 +76,13 @@ final class PhpDocInfoPrinter
|
||||||
|
|
||||||
private ?PhpDocInfo $phpDocInfo = null;
|
private ?PhpDocInfo $phpDocInfo = null;
|
||||||
|
|
||||||
private PhpDocNodeTraverser $changedPhpDocNodeTraverser;
|
private readonly PhpDocNodeTraverser $changedPhpDocNodeTraverser;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private EmptyPhpDocDetector $emptyPhpDocDetector,
|
private readonly EmptyPhpDocDetector $emptyPhpDocDetector,
|
||||||
private DocBlockInliner $docBlockInliner,
|
private readonly DocBlockInliner $docBlockInliner,
|
||||||
private RemoveNodesStartAndEndResolver $removeNodesStartAndEndResolver,
|
private readonly RemoveNodesStartAndEndResolver $removeNodesStartAndEndResolver,
|
||||||
private ChangedPhpDocNodeVisitor $changedPhpDocNodeVisitor,
|
private readonly ChangedPhpDocNodeVisitor $changedPhpDocNodeVisitor,
|
||||||
ChangedPhpDocNodeTraverserFactory $changedPhpDocNodeTraverserFactory
|
ChangedPhpDocNodeTraverserFactory $changedPhpDocNodeTraverserFactory
|
||||||
) {
|
) {
|
||||||
$this->changedPhpDocNodeTraverser = $changedPhpDocNodeTraverserFactory->create();
|
$this->changedPhpDocNodeTraverser = $changedPhpDocNodeTraverserFactory->create();
|
||||||
|
|
|
@ -20,7 +20,7 @@ final class BetterTokenIterator extends TokenIterator
|
||||||
*/
|
*/
|
||||||
private const INDEX = 'index';
|
private const INDEX = 'index';
|
||||||
|
|
||||||
private PrivatesAccessor $privatesAccessor;
|
private readonly PrivatesAccessor $privatesAccessor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<int, mixed> $tokens
|
* @param array<int, mixed> $tokens
|
||||||
|
|
|
@ -14,7 +14,7 @@ final class SpacingAwareTemplateTagValueNode extends TemplateTagValueNode implem
|
||||||
string $name,
|
string $name,
|
||||||
?TypeNode $typeNode,
|
?TypeNode $typeNode,
|
||||||
string $description,
|
string $description,
|
||||||
private string $preposition
|
private readonly string $preposition
|
||||||
) {
|
) {
|
||||||
parent::__construct($name, $typeNode, $description);
|
parent::__construct($name, $typeNode, $description);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,8 @@ use Rector\Core\Exception\ShouldNotHappenException;
|
||||||
final class StartAndEnd
|
final class StartAndEnd
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private int $start,
|
private readonly int $start,
|
||||||
private int $end
|
private readonly int $end
|
||||||
) {
|
) {
|
||||||
if ($end < $start) {
|
if ($end < $start) {
|
||||||
throw new ShouldNotHappenException();
|
throw new ShouldNotHappenException();
|
||||||
|
|
|
@ -15,7 +15,7 @@ final class BracketsAwareUnionTypeNode extends UnionTypeNode implements Stringab
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
array $types,
|
array $types,
|
||||||
private bool $isWrappedInBrackets = false
|
private readonly bool $isWrappedInBrackets = false
|
||||||
) {
|
) {
|
||||||
parent::__construct($types);
|
parent::__construct($types);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface;
|
||||||
final class Cache
|
final class Cache
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private CacheStorageInterface $cacheStorage
|
private readonly CacheStorageInterface $cacheStorage
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@ use Symplify\SmartFileSystem\SmartFileSystem;
|
||||||
final class CacheFactory
|
final class CacheFactory
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ParameterProvider $parameterProvider,
|
private readonly ParameterProvider $parameterProvider,
|
||||||
private SmartFileSystem $smartFileSystem
|
private readonly SmartFileSystem $smartFileSystem
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,8 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
||||||
final class ChangedFilesDetector
|
final class ChangedFilesDetector
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private FileHashComputer $fileHashComputer,
|
private readonly FileHashComputer $fileHashComputer,
|
||||||
private Cache $cache
|
private readonly Cache $cache
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,9 @@ use Symplify\PackageBuilder\Reflection\PrivatesAccessor;
|
||||||
final class DependencyResolver
|
final class DependencyResolver
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NodeScopeResolver $nodeScopeResolver,
|
private readonly NodeScopeResolver $nodeScopeResolver,
|
||||||
private PHPStanDependencyResolver $phpStanDependencyResolver,
|
private readonly PHPStanDependencyResolver $phpStanDependencyResolver,
|
||||||
private PrivatesAccessor $privatesAccessor
|
private readonly PrivatesAccessor $privatesAccessor
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
||||||
final class UnchangedFilesFilter
|
final class UnchangedFilesFilter
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ChangedFilesDetector $changedFilesDetector
|
private readonly ChangedFilesDetector $changedFilesDetector
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ namespace Rector\Caching\ValueObject;
|
||||||
final class CacheFilePaths
|
final class CacheFilePaths
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private string $firstDirectory,
|
private readonly string $firstDirectory,
|
||||||
private string $secondDirectory,
|
private readonly string $secondDirectory,
|
||||||
private string $filePath
|
private readonly string $filePath
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ final class CacheItem
|
||||||
* @param mixed $data
|
* @param mixed $data
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private string $variableKey,
|
private readonly string $variableKey,
|
||||||
private $data
|
private $data
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ use Rector\Core\Contract\Rector\RectorInterface;
|
||||||
final class RectorsChangelogResolver
|
final class RectorsChangelogResolver
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private AnnotationExtractor $annotationExtractor
|
private readonly AnnotationExtractor $annotationExtractor
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@ use Rector\Core\ValueObject\Application\File;
|
||||||
final class RectorChangeCollector
|
final class RectorChangeCollector
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private CurrentRectorProvider $currentRectorProvider,
|
private readonly CurrentRectorProvider $currentRectorProvider,
|
||||||
private CurrentFileProvider $currentFileProvider
|
private readonly CurrentFileProvider $currentFileProvider
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ final class ConsoleOutputFormatter implements OutputFormatterInterface
|
||||||
private const ON_LINE_REGEX = '# on line #';
|
private const ON_LINE_REGEX = '# on line #';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private OutputStyleInterface $outputStyle,
|
private readonly OutputStyleInterface $outputStyle,
|
||||||
private RectorsChangelogResolver $rectorsChangelogResolver
|
private readonly RectorsChangelogResolver $rectorsChangelogResolver
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ final class JsonOutputFormatter implements OutputFormatterInterface
|
||||||
public const NAME = 'json';
|
public const NAME = 'json';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private RectorsChangelogResolver $rectorsChangelogResolver
|
private readonly RectorsChangelogResolver $rectorsChangelogResolver
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,14 +22,14 @@ final class RectorWithLineChange implements SerializableInterface
|
||||||
/**
|
/**
|
||||||
* @var class-string<RectorInterface>
|
* @var class-string<RectorInterface>
|
||||||
*/
|
*/
|
||||||
private string $rectorClass;
|
private readonly string $rectorClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param class-string<RectorInterface>|RectorInterface $rectorClass
|
* @param class-string<RectorInterface>|RectorInterface $rectorClass
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string|RectorInterface $rectorClass,
|
string|RectorInterface $rectorClass,
|
||||||
private int $line
|
private readonly int $line
|
||||||
) {
|
) {
|
||||||
if ($rectorClass instanceof RectorInterface) {
|
if ($rectorClass instanceof RectorInterface) {
|
||||||
$rectorClass = $rectorClass::class;
|
$rectorClass = $rectorClass::class;
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
||||||
final class ErrorFactory
|
final class ErrorFactory
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ExceptionCorrector $exceptionCorrector
|
private readonly ExceptionCorrector $exceptionCorrector
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ use Symplify\ConsoleColorDiff\Console\Output\ConsoleDiffer;
|
||||||
final class FileDiffFactory
|
final class FileDiffFactory
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private DefaultDiffer $defaultDiffer,
|
private readonly DefaultDiffer $defaultDiffer,
|
||||||
private ConsoleDiffer $consoleDiffer
|
private readonly ConsoleDiffer $consoleDiffer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||||
final class CommentRemover
|
final class CommentRemover
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private CommentRemovingNodeTraverser $commentRemovingNodeTraverser
|
private readonly CommentRemovingNodeTraverser $commentRemovingNodeTraverser
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ final class DocBlockUpdater
|
||||||
public const SPACE_OR_ASTERISK_REGEX = '#(\s|\*)+#';
|
public const SPACE_OR_ASTERISK_REGEX = '#(\s|\*)+#';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private PhpDocInfoPrinter $phpDocInfoPrinter
|
private readonly PhpDocInfoPrinter $phpDocInfoPrinter
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@ use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
|
||||||
final class FluentChainMethodCallNodeAnalyzer
|
final class FluentChainMethodCallNodeAnalyzer
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NodeNameResolver $nodeNameResolver,
|
private readonly NodeNameResolver $nodeNameResolver,
|
||||||
private NodeTypeResolver $nodeTypeResolver,
|
private readonly NodeTypeResolver $nodeTypeResolver,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ use Rector\Core\Reflection\ReflectionResolver;
|
||||||
final class SameClassMethodCallAnalyzer
|
final class SameClassMethodCallAnalyzer
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ReflectionResolver $reflectionResolver,
|
private readonly ReflectionResolver $reflectionResolver,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ use Rector\FamilyTree\Reflection\FamilyRelationsAnalyzer;
|
||||||
final class ClassChildAnalyzer
|
final class ClassChildAnalyzer
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private FamilyRelationsAnalyzer $familyRelationsAnalyzer
|
private readonly FamilyRelationsAnalyzer $familyRelationsAnalyzer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,12 +33,12 @@ use Symplify\PackageBuilder\Reflection\PrivatesAccessor;
|
||||||
final class FamilyRelationsAnalyzer
|
final class FamilyRelationsAnalyzer
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ReflectionProvider $reflectionProvider,
|
private readonly ReflectionProvider $reflectionProvider,
|
||||||
private PrivatesAccessor $privatesAccessor,
|
private readonly PrivatesAccessor $privatesAccessor,
|
||||||
private NodeNameResolver $nodeNameResolver,
|
private readonly NodeNameResolver $nodeNameResolver,
|
||||||
private BetterNodeFinder $betterNodeFinder,
|
private readonly BetterNodeFinder $betterNodeFinder,
|
||||||
private StaticTypeMapper $staticTypeMapper,
|
private readonly StaticTypeMapper $staticTypeMapper,
|
||||||
private AstResolver $astResolver,
|
private readonly AstResolver $astResolver,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ use PHPStan\Type\Type;
|
||||||
final class PropertyType
|
final class PropertyType
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private Type $varType,
|
private readonly Type $varType,
|
||||||
private Name|ComplexType|null $propertyTypeNode
|
private readonly Name|ComplexType|null $propertyTypeNode
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ use Rector\FileFormatter\ValueObjectFactory\EditorConfigConfigurationBuilder;
|
||||||
final class EditorConfigParser
|
final class EditorConfigParser
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private EditorConfig $editorConfig
|
private readonly EditorConfig $editorConfig
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,9 @@ final class FileFormatter
|
||||||
* @param FileFormatterInterface[] $fileFormatters
|
* @param FileFormatterInterface[] $fileFormatters
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private EditorConfigParser $editorConfigParser,
|
private readonly EditorConfigParser $editorConfigParser,
|
||||||
private ParameterProvider $parameterProvider,
|
private readonly ParameterProvider $parameterProvider,
|
||||||
private array $fileFormatters = []
|
private readonly array $fileFormatters = []
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ use Rector\FileFormatter\ValueObjectFactory\EditorConfigConfigurationBuilder;
|
||||||
final class JsonFileFormatter implements FileFormatterInterface
|
final class JsonFileFormatter implements FileFormatterInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private PrinterInterface $jsonPrinter
|
private readonly PrinterInterface $jsonPrinter
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace Rector\FileFormatter\ValueObject;
|
||||||
final class EditorConfigConfiguration
|
final class EditorConfigConfiguration
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private Indent $indent,
|
private readonly Indent $indent,
|
||||||
private NewLine $newLine,
|
private readonly NewLine $newLine,
|
||||||
private bool $insertFinalNewline
|
private readonly bool $insertFinalNewline
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ final class Indent implements Stringable
|
||||||
private const PARSE_INDENT_REGEX = '/^(?P<indent>( +|\t+)).*/m';
|
private const PARSE_INDENT_REGEX = '/^(?P<indent>( +|\t+)).*/m';
|
||||||
|
|
||||||
private function __construct(
|
private function __construct(
|
||||||
private string $string
|
private readonly string $string
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ final class NewLine implements Stringable
|
||||||
private const VALID_NEWLINE_REGEX = '#^(?>\r\n|\n|\r)$#';
|
private const VALID_NEWLINE_REGEX = '#^(?>\r\n|\n|\r)$#';
|
||||||
|
|
||||||
private function __construct(
|
private function __construct(
|
||||||
private string $string
|
private readonly string $string
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
||||||
final class FileInfoParser
|
final class FileInfoParser
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NodeScopeAndMetadataDecorator $nodeScopeAndMetadataDecorator,
|
private readonly NodeScopeAndMetadataDecorator $nodeScopeAndMetadataDecorator,
|
||||||
private RectorParser $rectorParser
|
private readonly RectorParser $rectorParser
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@ use Rector\FileSystemRector\Contract\AddedFileInterface;
|
||||||
final class AddedFileWithContent implements AddedFileInterface
|
final class AddedFileWithContent implements AddedFileInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private string $filePath,
|
private readonly string $filePath,
|
||||||
private string $fileContent
|
private readonly string $fileContent
|
||||||
) {
|
) {
|
||||||
if ($filePath === $fileContent) {
|
if ($filePath === $fileContent) {
|
||||||
throw new ShouldNotHappenException('File path and content are the same, probably a bug');
|
throw new ShouldNotHappenException('File path and content are the same, probably a bug');
|
||||||
|
|
|
@ -14,8 +14,8 @@ final class AddedFileWithNodes implements AddedFileInterface, FileWithNodesInter
|
||||||
* @param Node\Stmt[] $nodes
|
* @param Node\Stmt[] $nodes
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private string $filePath,
|
private readonly string $filePath,
|
||||||
private array $nodes
|
private readonly array $nodes
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,11 +22,11 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
||||||
final class AddedFileWithNodesFactory
|
final class AddedFileWithNodesFactory
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private BetterNodeFinder $betterNodeFinder,
|
private readonly BetterNodeFinder $betterNodeFinder,
|
||||||
private CategoryNamespaceProvider $categoryNamespaceProvider,
|
private readonly CategoryNamespaceProvider $categoryNamespaceProvider,
|
||||||
private FileRelocationResolver $fileRelocationResolver,
|
private readonly FileRelocationResolver $fileRelocationResolver,
|
||||||
private RenamedClassesDataCollector $renamedClassesDataCollector,
|
private readonly RenamedClassesDataCollector $renamedClassesDataCollector,
|
||||||
private FileInfoDeletionAnalyzer $fileInfoDeletionAnalyzer
|
private readonly FileInfoDeletionAnalyzer $fileInfoDeletionAnalyzer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,11 +31,11 @@ use Rector\NodeTypeResolver\NodeTypeResolver;
|
||||||
final class ArrayCallableMethodMatcher
|
final class ArrayCallableMethodMatcher
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NodeNameResolver $nodeNameResolver,
|
private readonly NodeNameResolver $nodeNameResolver,
|
||||||
private NodeTypeResolver $nodeTypeResolver,
|
private readonly NodeTypeResolver $nodeTypeResolver,
|
||||||
private ValueResolver $valueResolver,
|
private readonly ValueResolver $valueResolver,
|
||||||
private ReflectionProvider $reflectionProvider,
|
private readonly ReflectionProvider $reflectionProvider,
|
||||||
private BetterNodeFinder $betterNodeFinder,
|
private readonly BetterNodeFinder $betterNodeFinder,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Rector\Core\Util\StringUtils;
|
||||||
final class StaticAnalyzer
|
final class StaticAnalyzer
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ReflectionProvider $reflectionProvider
|
private readonly ReflectionProvider $reflectionProvider
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@ use PhpParser\Node\Expr;
|
||||||
final class ArrayCallable
|
final class ArrayCallable
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private Expr $callerExpr,
|
private readonly Expr $callerExpr,
|
||||||
private string $class,
|
private readonly string $class,
|
||||||
private string $method
|
private readonly string $method
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@ use PhpParser\Node\Expr;
|
||||||
final class ArrayCallableDynamicMethod
|
final class ArrayCallableDynamicMethod
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private Expr $callerExpr,
|
private readonly Expr $callerExpr,
|
||||||
private string $class,
|
private readonly string $class,
|
||||||
private Expr $method
|
private readonly Expr $method
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@ final class InvalidNameNodeReporter
|
||||||
private const FILE = 'file';
|
private const FILE = 'file';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private CurrentFileProvider $currentFileProvider,
|
private readonly CurrentFileProvider $currentFileProvider,
|
||||||
private BetterStandardPrinter $betterStandardPrinter
|
private readonly BetterStandardPrinter $betterStandardPrinter
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,11 +27,11 @@ final class NodeNameResolver
|
||||||
* @param NodeNameResolverInterface[] $nodeNameResolvers
|
* @param NodeNameResolverInterface[] $nodeNameResolvers
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private RegexPatternDetector $regexPatternDetector,
|
private readonly RegexPatternDetector $regexPatternDetector,
|
||||||
private ClassNaming $classNaming,
|
private readonly ClassNaming $classNaming,
|
||||||
private InvalidNameNodeReporter $invalidNameNodeReporter,
|
private readonly InvalidNameNodeReporter $invalidNameNodeReporter,
|
||||||
private CallAnalyzer $callAnalyzer,
|
private readonly CallAnalyzer $callAnalyzer,
|
||||||
private array $nodeNameResolvers = []
|
private readonly array $nodeNameResolvers = []
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||||
final class FuncCallNameResolver implements NodeNameResolverInterface
|
final class FuncCallNameResolver implements NodeNameResolverInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ReflectionProvider $reflectionProvider
|
private readonly ReflectionProvider $reflectionProvider
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||||
final class NameNameResolver implements NodeNameResolverInterface
|
final class NameNameResolver implements NodeNameResolverInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private FuncCallNameResolver $funcCallNameResolver
|
private readonly FuncCallNameResolver $funcCallNameResolver
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,8 @@ final class ContextAnalyzer
|
||||||
private const LOOP_NODES = [For_::class, Foreach_::class, While_::class, Do_::class];
|
private const LOOP_NODES = [For_::class, Foreach_::class, While_::class, Do_::class];
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private BetterNodeFinder $betterNodeFinder,
|
private readonly BetterNodeFinder $betterNodeFinder,
|
||||||
private NodeTypeResolver $nodeTypeResolver,
|
private readonly NodeTypeResolver $nodeTypeResolver,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ final class ScopeAwareNodeFinder
|
||||||
private bool $isBreakingNodeFoundFirst = false;
|
private bool $isBreakingNodeFoundFirst = false;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private BetterNodeFinder $betterNodeFinder
|
private readonly BetterNodeFinder $betterNodeFinder
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||||
final class ParentScopeFinder
|
final class ParentScopeFinder
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private BetterNodeFinder $betterNodeFinder,
|
private readonly BetterNodeFinder $betterNodeFinder,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ final class ScopeNestingComparator
|
||||||
private array $doubleIfBranchExprs = [];
|
private array $doubleIfBranchExprs = [];
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private BetterNodeFinder $betterNodeFinder,
|
private readonly BetterNodeFinder $betterNodeFinder,
|
||||||
private NodeComparator $nodeComparator,
|
private readonly NodeComparator $nodeComparator,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@ use Rector\PostRector\Collector\NodesToReplaceCollector;
|
||||||
final class AssignRemover
|
final class AssignRemover
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NodesToReplaceCollector $nodesToReplaceCollector,
|
private readonly NodesToReplaceCollector $nodesToReplaceCollector,
|
||||||
private RectorChangeCollector $rectorChangeCollector,
|
private readonly RectorChangeCollector $rectorChangeCollector,
|
||||||
private NodeRemover $nodeRemover,
|
private readonly NodeRemover $nodeRemover,
|
||||||
private LivingCodeManipulator $livingCodeManipulator
|
private readonly LivingCodeManipulator $livingCodeManipulator
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@ use Rector\PostRector\Collector\NodesToRemoveCollector;
|
||||||
final class NodeRemover
|
final class NodeRemover
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NodesToRemoveCollector $nodesToRemoveCollector,
|
private readonly NodesToRemoveCollector $nodesToRemoveCollector,
|
||||||
private RectorChangeCollector $rectorChangeCollector
|
private readonly RectorChangeCollector $rectorChangeCollector
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ use Symplify\PackageBuilder\Parameter\ParameterProvider;
|
||||||
*/
|
*/
|
||||||
final class PHPStanServicesFactory
|
final class PHPStanServicesFactory
|
||||||
{
|
{
|
||||||
private Container $container;
|
private readonly Container $container;
|
||||||
|
|
||||||
public function __construct(ParameterProvider $parameterProvider)
|
public function __construct(ParameterProvider $parameterProvider)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@ use Rector\Core\Reflection\ReflectionResolver;
|
||||||
final class MethodParameterTypeResolver
|
final class MethodParameterTypeResolver
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ReflectionResolver $reflectionResolver,
|
private readonly ReflectionResolver $reflectionResolver,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,12 @@ use Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver;
|
||||||
final class NodeScopeAndMetadataDecorator
|
final class NodeScopeAndMetadataDecorator
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private CloningVisitor $cloningVisitor,
|
private readonly CloningVisitor $cloningVisitor,
|
||||||
private NamespaceNodeVisitor $namespaceNodeVisitor,
|
private readonly NamespaceNodeVisitor $namespaceNodeVisitor,
|
||||||
private PHPStanNodeScopeResolver $phpStanNodeScopeResolver,
|
private readonly PHPStanNodeScopeResolver $phpStanNodeScopeResolver,
|
||||||
private StatementNodeVisitor $statementNodeVisitor,
|
private readonly StatementNodeVisitor $statementNodeVisitor,
|
||||||
private NodeConnectingVisitor $nodeConnectingVisitor,
|
private readonly NodeConnectingVisitor $nodeConnectingVisitor,
|
||||||
private FunctionLikeParamArgPositionNodeVisitor $functionLikeParamArgPositionNodeVisitor
|
private readonly FunctionLikeParamArgPositionNodeVisitor $functionLikeParamArgPositionNodeVisitor
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use PHPStan\Type\TypeTraverser;
|
||||||
final class GenericClassStringTypeCorrector
|
final class GenericClassStringTypeCorrector
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ReflectionProvider $reflectionProvider
|
private readonly ReflectionProvider $reflectionProvider
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,11 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||||
final class PregMatchTypeCorrector
|
final class PregMatchTypeCorrector
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private BetterNodeFinder $betterNodeFinder,
|
private readonly BetterNodeFinder $betterNodeFinder,
|
||||||
private NodeNameResolver $nodeNameResolver,
|
private readonly NodeNameResolver $nodeNameResolver,
|
||||||
private ParentScopeFinder $parentScopeFinder,
|
private readonly ParentScopeFinder $parentScopeFinder,
|
||||||
private NodeComparator $nodeComparator,
|
private readonly NodeComparator $nodeComparator,
|
||||||
private ArgsAnalyzer $argsAnalyzer
|
private readonly ArgsAnalyzer $argsAnalyzer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,15 +57,15 @@ final class NodeTypeResolver
|
||||||
* @param NodeTypeResolverInterface[] $nodeTypeResolvers
|
* @param NodeTypeResolverInterface[] $nodeTypeResolvers
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ObjectTypeSpecifier $objectTypeSpecifier,
|
private readonly ObjectTypeSpecifier $objectTypeSpecifier,
|
||||||
private ClassAnalyzer $classAnalyzer,
|
private readonly ClassAnalyzer $classAnalyzer,
|
||||||
private GenericClassStringTypeCorrector $genericClassStringTypeCorrector,
|
private readonly GenericClassStringTypeCorrector $genericClassStringTypeCorrector,
|
||||||
private ReflectionProvider $reflectionProvider,
|
private readonly ReflectionProvider $reflectionProvider,
|
||||||
private HasOffsetTypeCorrector $hasOffsetTypeCorrector,
|
private readonly HasOffsetTypeCorrector $hasOffsetTypeCorrector,
|
||||||
private AccessoryNonEmptyStringTypeCorrector $accessoryNonEmptyStringTypeCorrector,
|
private readonly AccessoryNonEmptyStringTypeCorrector $accessoryNonEmptyStringTypeCorrector,
|
||||||
private IdentifierTypeResolver $identifierTypeResolver,
|
private readonly IdentifierTypeResolver $identifierTypeResolver,
|
||||||
private RenamedClassesDataCollector $renamedClassesDataCollector,
|
private readonly RenamedClassesDataCollector $renamedClassesDataCollector,
|
||||||
private BetterNodeFinder $betterNodeFinder,
|
private readonly BetterNodeFinder $betterNodeFinder,
|
||||||
array $nodeTypeResolvers
|
array $nodeTypeResolvers
|
||||||
) {
|
) {
|
||||||
foreach ($nodeTypeResolvers as $nodeTypeResolver) {
|
foreach ($nodeTypeResolvers as $nodeTypeResolver) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||||
final class ClassAndInterfaceTypeResolver implements NodeTypeResolverInterface
|
final class ClassAndInterfaceTypeResolver implements NodeTypeResolverInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NodeNameResolver $nodeNameResolver
|
private readonly NodeNameResolver $nodeNameResolver
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ final class ClassMethodOrClassConstTypeResolver implements NodeTypeResolverInter
|
||||||
private NodeTypeResolver $nodeTypeResolver;
|
private NodeTypeResolver $nodeTypeResolver;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private BetterNodeFinder $betterNodeFinder
|
private readonly BetterNodeFinder $betterNodeFinder
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,9 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||||
final class NameTypeResolver implements NodeTypeResolverInterface
|
final class NameTypeResolver implements NodeTypeResolverInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ReflectionProvider $reflectionProvider,
|
private readonly ReflectionProvider $reflectionProvider,
|
||||||
private BetterNodeFinder $betterNodeFinder,
|
private readonly BetterNodeFinder $betterNodeFinder,
|
||||||
private NodeNameResolver $nodeNameResolver
|
private readonly NodeNameResolver $nodeNameResolver
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
|
||||||
final class NewTypeResolver implements NodeTypeResolverInterface
|
final class NewTypeResolver implements NodeTypeResolverInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NodeNameResolver $nodeNameResolver,
|
private readonly NodeNameResolver $nodeNameResolver,
|
||||||
private ClassAnalyzer $classAnalyzer,
|
private readonly ClassAnalyzer $classAnalyzer,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,10 +37,10 @@ final class ParamTypeResolver implements NodeTypeResolverInterface
|
||||||
private StaticTypeMapper $staticTypeMapper;
|
private StaticTypeMapper $staticTypeMapper;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private SimpleCallableNodeTraverser $simpleCallableNodeTraverser,
|
private readonly SimpleCallableNodeTraverser $simpleCallableNodeTraverser,
|
||||||
private NodeNameResolver $nodeNameResolver,
|
private readonly NodeNameResolver $nodeNameResolver,
|
||||||
private PhpDocInfoFactory $phpDocInfoFactory,
|
private readonly PhpDocInfoFactory $phpDocInfoFactory,
|
||||||
private BetterNodeFinder $betterNodeFinder,
|
private readonly BetterNodeFinder $betterNodeFinder,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,9 @@ final class PropertyFetchTypeResolver implements NodeTypeResolverInterface
|
||||||
private NodeTypeResolver $nodeTypeResolver;
|
private NodeTypeResolver $nodeTypeResolver;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NodeNameResolver $nodeNameResolver,
|
private readonly NodeNameResolver $nodeNameResolver,
|
||||||
private ReflectionProvider $reflectionProvider,
|
private readonly ReflectionProvider $reflectionProvider,
|
||||||
private BetterNodeFinder $betterNodeFinder
|
private readonly BetterNodeFinder $betterNodeFinder
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ final class StaticCallMethodCallTypeResolver implements NodeTypeResolverInterfac
|
||||||
private NodeTypeResolver $nodeTypeResolver;
|
private NodeTypeResolver $nodeTypeResolver;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NodeNameResolver $nodeNameResolver,
|
private readonly NodeNameResolver $nodeNameResolver,
|
||||||
private ReflectionProvider $reflectionProvider
|
private readonly ReflectionProvider $reflectionProvider
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ use Rector\NodeTypeResolver\Contract\NodeTypeResolverInterface;
|
||||||
final class TraitTypeResolver implements NodeTypeResolverInterface
|
final class TraitTypeResolver implements NodeTypeResolverInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ReflectionProvider $reflectionProvider
|
private readonly ReflectionProvider $reflectionProvider
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||||
final class VariableTypeResolver implements NodeTypeResolverInterface
|
final class VariableTypeResolver implements NodeTypeResolverInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NodeNameResolver $nodeNameResolver,
|
private readonly NodeNameResolver $nodeNameResolver,
|
||||||
private PhpDocInfoFactory $phpDocInfoFactory
|
private readonly PhpDocInfoFactory $phpDocInfoFactory
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ final class NamespaceNodeVisitor extends NodeVisitorAbstract
|
||||||
private array $useNodes = [];
|
private array $useNodes = [];
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private BetterNodeFinder $betterNodeFinder
|
private readonly BetterNodeFinder $betterNodeFinder
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,12 +19,12 @@ use Symplify\PackageBuilder\Parameter\ParameterProvider;
|
||||||
*/
|
*/
|
||||||
final class RemoveDeepChainMethodCallNodeVisitor extends NodeVisitorAbstract
|
final class RemoveDeepChainMethodCallNodeVisitor extends NodeVisitorAbstract
|
||||||
{
|
{
|
||||||
private int $nestedChainMethodCallLimit;
|
private readonly int $nestedChainMethodCallLimit;
|
||||||
|
|
||||||
private ?Expression $removingExpression = null;
|
private ?Expression $removingExpression = null;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private BetterNodeFinder $betterNodeFinder,
|
private readonly BetterNodeFinder $betterNodeFinder,
|
||||||
ParameterProvider $parameterProvider
|
ParameterProvider $parameterProvider
|
||||||
) {
|
) {
|
||||||
$this->nestedChainMethodCallLimit = (int) $parameterProvider->provideParameter(
|
$this->nestedChainMethodCallLimit = (int) $parameterProvider->provideParameter(
|
||||||
|
|
|
@ -47,16 +47,16 @@ final class PHPStanNodeScopeResolver
|
||||||
private const CONTEXT = 'context';
|
private const CONTEXT = 'context';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ChangedFilesDetector $changedFilesDetector,
|
private readonly ChangedFilesDetector $changedFilesDetector,
|
||||||
private DependencyResolver $dependencyResolver,
|
private readonly DependencyResolver $dependencyResolver,
|
||||||
private NodeScopeResolver $nodeScopeResolver,
|
private readonly NodeScopeResolver $nodeScopeResolver,
|
||||||
private ReflectionProvider $reflectionProvider,
|
private readonly ReflectionProvider $reflectionProvider,
|
||||||
private RemoveDeepChainMethodCallNodeVisitor $removeDeepChainMethodCallNodeVisitor,
|
private readonly RemoveDeepChainMethodCallNodeVisitor $removeDeepChainMethodCallNodeVisitor,
|
||||||
private ScopeFactory $scopeFactory,
|
private readonly ScopeFactory $scopeFactory,
|
||||||
private PrivatesAccessor $privatesAccessor,
|
private readonly PrivatesAccessor $privatesAccessor,
|
||||||
private RenamedClassesSourceLocator $renamedClassesSourceLocator,
|
private readonly RenamedClassesSourceLocator $renamedClassesSourceLocator,
|
||||||
private ParentAttributeSourceLocator $parentAttributeSourceLocator,
|
private readonly ParentAttributeSourceLocator $parentAttributeSourceLocator,
|
||||||
private TraitScopeFaker $traitScopeFaker,
|
private readonly TraitScopeFaker $traitScopeFaker,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
||||||
final class ScopeFactory
|
final class ScopeFactory
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private PHPStanScopeFactory $phpStanScopeFactory
|
private readonly PHPStanScopeFactory $phpStanScopeFactory
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@ use Symplify\PackageBuilder\Reflection\PrivatesAccessor;
|
||||||
final class TraitScopeFaker
|
final class TraitScopeFaker
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private PrivatesAccessor $privatesAccessor,
|
private readonly PrivatesAccessor $privatesAccessor,
|
||||||
private ReflectionProvider $reflectionProvider
|
private readonly ReflectionProvider $reflectionProvider
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ use Rector\PHPStanStaticTypeMapper\TypeAnalyzer\UnionTypeAnalyzer;
|
||||||
final class StaticTypeAnalyzer
|
final class StaticTypeAnalyzer
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private UnionTypeAnalyzer $unionTypeAnalyzer
|
private readonly UnionTypeAnalyzer $unionTypeAnalyzer
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ use Rector\NodeTypeResolver\PHPStan\TypeHasher;
|
||||||
final class TypeFactory
|
final class TypeFactory
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private TypeHasher $typeHasher,
|
private readonly TypeHasher $typeHasher,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ use Rector\NodeTypeResolver\ValueObject\OldToNewType;
|
||||||
final class DocBlockClassRenamer
|
final class DocBlockClassRenamer
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ClassRenamePhpDocNodeVisitor $classRenamePhpDocNodeVisitor,
|
private readonly ClassRenamePhpDocNodeVisitor $classRenamePhpDocNodeVisitor,
|
||||||
private RenamingPhpDocNodeVisitorFactory $renamingPhpDocNodeVisitorFactory
|
private readonly RenamingPhpDocNodeVisitorFactory $renamingPhpDocNodeVisitorFactory
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ use Rector\NodeTypeResolver\PhpDocNodeVisitor\NameImportingPhpDocNodeVisitor;
|
||||||
final class DocBlockNameImporter
|
final class DocBlockNameImporter
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private NameImportingPhpDocNodeVisitor $nameImportingPhpDocNodeVisitor,
|
private readonly NameImportingPhpDocNodeVisitor $nameImportingPhpDocNodeVisitor,
|
||||||
private ImportingPhpDocNodeTraverserFactory $importingPhpDocNodeTraverserFactory
|
private readonly ImportingPhpDocNodeTraverserFactory $importingPhpDocNodeTraverserFactory
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||||
final class DocBlockTagReplacer
|
final class DocBlockTagReplacer
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private AnnotationNaming $annotationNaming
|
private readonly AnnotationNaming $annotationNaming
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user