mirror of https://github.com/rectorphp/rector.git
[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
|
@ -57,10 +57,9 @@ jobs:
|
|||
- 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
|
||||
# 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
|
||||
-
|
||||
|
|
|
@ -12,7 +12,7 @@ use Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser;
|
|||
final class CommentsMerger
|
||||
{
|
||||
public function __construct(
|
||||
private SimpleCallableNodeTraverser $simpleCallableNodeTraverser
|
||||
private readonly SimpleCallableNodeTraverser $simpleCallableNodeTraverser
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -49,19 +49,19 @@ final class PhpDocInfo
|
|||
|
||||
private bool $isSingleLine = false;
|
||||
|
||||
private PhpDocNode $originalPhpDocNode;
|
||||
private readonly PhpDocNode $originalPhpDocNode;
|
||||
|
||||
private bool $hasChanged = false;
|
||||
|
||||
public function __construct(
|
||||
private PhpDocNode $phpDocNode,
|
||||
private BetterTokenIterator $betterTokenIterator,
|
||||
private StaticTypeMapper $staticTypeMapper,
|
||||
private \PhpParser\Node $node,
|
||||
private AnnotationNaming $annotationNaming,
|
||||
private CurrentNodeProvider $currentNodeProvider,
|
||||
private RectorChangeCollector $rectorChangeCollector,
|
||||
private PhpDocNodeByTypeFinder $phpDocNodeByTypeFinder
|
||||
private readonly PhpDocNode $phpDocNode,
|
||||
private readonly BetterTokenIterator $betterTokenIterator,
|
||||
private readonly StaticTypeMapper $staticTypeMapper,
|
||||
private readonly \PhpParser\Node $node,
|
||||
private readonly AnnotationNaming $annotationNaming,
|
||||
private readonly CurrentNodeProvider $currentNodeProvider,
|
||||
private readonly RectorChangeCollector $rectorChangeCollector,
|
||||
private readonly PhpDocNodeByTypeFinder $phpDocNodeByTypeFinder
|
||||
) {
|
||||
$this->originalPhpDocNode = clone $phpDocNode;
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ final class PhpDocInfoFactory
|
|||
private array $phpDocInfosByObjectHash = [];
|
||||
|
||||
public function __construct(
|
||||
private PhpDocNodeMapper $phpDocNodeMapper,
|
||||
private CurrentNodeProvider $currentNodeProvider,
|
||||
private Lexer $lexer,
|
||||
private BetterPhpDocParser $betterPhpDocParser,
|
||||
private StaticTypeMapper $staticTypeMapper,
|
||||
private AnnotationNaming $annotationNaming,
|
||||
private RectorChangeCollector $rectorChangeCollector,
|
||||
private PhpDocNodeByTypeFinder $phpDocNodeByTypeFinder
|
||||
private readonly PhpDocNodeMapper $phpDocNodeMapper,
|
||||
private readonly CurrentNodeProvider $currentNodeProvider,
|
||||
private readonly Lexer $lexer,
|
||||
private readonly BetterPhpDocParser $betterPhpDocParser,
|
||||
private readonly StaticTypeMapper $staticTypeMapper,
|
||||
private readonly AnnotationNaming $annotationNaming,
|
||||
private readonly RectorChangeCollector $rectorChangeCollector,
|
||||
private readonly PhpDocNodeByTypeFinder $phpDocNodeByTypeFinder
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ final class TokenIteratorFactory
|
|||
private const INDEX = 'index';
|
||||
|
||||
public function __construct(
|
||||
private Lexer $lexer,
|
||||
private PrivatesAccessor $privatesAccessor
|
||||
private readonly Lexer $lexer,
|
||||
private readonly PrivatesAccessor $privatesAccessor
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNod
|
|||
final class PhpDocClassRenamer
|
||||
{
|
||||
public function __construct(
|
||||
private ClassAnnotationMatcher $classAnnotationMatcher
|
||||
private readonly ClassAnnotationMatcher $classAnnotationMatcher
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -25,10 +25,10 @@ use Rector\TypeDeclaration\PhpDocParser\ParamPhpDocNodeFactory;
|
|||
final class PhpDocTypeChanger
|
||||
{
|
||||
public function __construct(
|
||||
private StaticTypeMapper $staticTypeMapper,
|
||||
private TypeComparator $typeComparator,
|
||||
private ParamPhpDocNodeFactory $paramPhpDocNodeFactory,
|
||||
private NodeNameResolver $nodeNameResolver
|
||||
private readonly StaticTypeMapper $staticTypeMapper,
|
||||
private readonly TypeComparator $typeComparator,
|
||||
private readonly ParamPhpDocNodeFactory $paramPhpDocNodeFactory,
|
||||
private readonly NodeNameResolver $nodeNameResolver
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ use Rector\Naming\ValueObject\ParamRename;
|
|||
final class PropertyDocBlockManipulator
|
||||
{
|
||||
public function __construct(
|
||||
private PhpDocInfoFactory $phpDocInfoFactory
|
||||
private readonly PhpDocInfoFactory $phpDocInfoFactory
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
|||
final class VarAnnotationManipulator
|
||||
{
|
||||
public function __construct(
|
||||
private PhpDocInfoFactory $phpDocInfoFactory,
|
||||
private PhpDocTypeChanger $phpDocTypeChanger
|
||||
private readonly PhpDocInfoFactory $phpDocInfoFactory,
|
||||
private readonly PhpDocTypeChanger $phpDocTypeChanger
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -21,10 +21,10 @@ final class PhpDocNodeMapper
|
|||
* @param BasePhpDocNodeVisitorInterface[] $phpDocNodeVisitors
|
||||
*/
|
||||
public function __construct(
|
||||
private CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
||||
private ParentConnectingPhpDocNodeVisitor $parentConnectingPhpDocNodeVisitor,
|
||||
private CloningPhpDocNodeVisitor $cloningPhpDocNodeVisitor,
|
||||
private array $phpDocNodeVisitors
|
||||
private readonly CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
||||
private readonly ParentConnectingPhpDocNodeVisitor $parentConnectingPhpDocNodeVisitor,
|
||||
private readonly CloningPhpDocNodeVisitor $cloningPhpDocNodeVisitor,
|
||||
private readonly array $phpDocNodeVisitors
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ use Symplify\SimplePhpDocParser\PhpDocNodeTraverser;
|
|||
final class ChangedPhpDocNodeTraverserFactory
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
public function __construct(
|
||||
private CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
||||
private AttributeMirrorer $attributeMirrorer
|
||||
private readonly CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
||||
private readonly AttributeMirrorer $attributeMirrorer
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ use Symplify\SimplePhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor;
|
|||
final class UnionTypeNodePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements BasePhpDocNodeVisitorInterface
|
||||
{
|
||||
public function __construct(
|
||||
private CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
||||
private AttributeMirrorer $attributeMirrorer
|
||||
private readonly CurrentTokenIteratorProvider $currentTokenIteratorProvider,
|
||||
private readonly AttributeMirrorer $attributeMirrorer
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -26,13 +26,13 @@ use Symplify\PackageBuilder\Reflection\PrivatesCaller;
|
|||
*/
|
||||
final class BetterPhpDocParser extends PhpDocParser
|
||||
{
|
||||
private PrivatesCaller $privatesCaller;
|
||||
private readonly PrivatesCaller $privatesCaller;
|
||||
|
||||
public function __construct(
|
||||
TypeParser $typeParser,
|
||||
ConstExprParser $constExprParser,
|
||||
private TokenIteratorFactory $tokenIteratorFactory,
|
||||
private DoctrineAnnotationDecorator $doctrineAnnotationDecorator
|
||||
private readonly TokenIteratorFactory $tokenIteratorFactory,
|
||||
private readonly DoctrineAnnotationDecorator $doctrineAnnotationDecorator
|
||||
) {
|
||||
parent::__construct($typeParser, $constExprParser);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ use Rector\BetterPhpDocParser\ValueObject\StartAndEnd;
|
|||
final class BetterTypeParser extends TypeParser
|
||||
{
|
||||
public function __construct(
|
||||
private TokenIteratorFactory $tokenIteratorFactory,
|
||||
private readonly TokenIteratorFactory $tokenIteratorFactory,
|
||||
?ConstExprParser $constExprParser = null
|
||||
) {
|
||||
parent::__construct($constExprParser);
|
||||
|
|
|
@ -22,8 +22,8 @@ final class ClassAnnotationMatcher
|
|||
private array $fullyQualifiedNameByHash = [];
|
||||
|
||||
public function __construct(
|
||||
private UseImportNameMatcher $useImportNameMatcher,
|
||||
private ReflectionProvider $reflectionProvider
|
||||
private readonly UseImportNameMatcher $useImportNameMatcher,
|
||||
private readonly ReflectionProvider $reflectionProvider
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -45,11 +45,11 @@ final class DoctrineAnnotationDecorator
|
|||
private const NESTED_ANNOTATION_END_REGEX = '#(\s+)?\}\)(\s+)?#';
|
||||
|
||||
public function __construct(
|
||||
private CurrentNodeProvider $currentNodeProvider,
|
||||
private ClassAnnotationMatcher $classAnnotationMatcher,
|
||||
private StaticDoctrineAnnotationParser $staticDoctrineAnnotationParser,
|
||||
private TokenIteratorFactory $tokenIteratorFactory,
|
||||
private AttributeMirrorer $attributeMirrorer
|
||||
private readonly CurrentNodeProvider $currentNodeProvider,
|
||||
private readonly ClassAnnotationMatcher $classAnnotationMatcher,
|
||||
private readonly StaticDoctrineAnnotationParser $staticDoctrineAnnotationParser,
|
||||
private readonly TokenIteratorFactory $tokenIteratorFactory,
|
||||
private readonly AttributeMirrorer $attributeMirrorer
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -24,11 +24,11 @@ use Rector\StaticTypeMapper\StaticTypeMapper;
|
|||
final class PhpDocFromTypeDeclarationDecorator
|
||||
{
|
||||
public function __construct(
|
||||
private StaticTypeMapper $staticTypeMapper,
|
||||
private PhpDocInfoFactory $phpDocInfoFactory,
|
||||
private NodeNameResolver $nodeNameResolver,
|
||||
private PhpDocTypeChanger $phpDocTypeChanger,
|
||||
private TypeUnwrapper $typeUnwrapper
|
||||
private readonly StaticTypeMapper $staticTypeMapper,
|
||||
private readonly PhpDocInfoFactory $phpDocInfoFactory,
|
||||
private readonly NodeNameResolver $nodeNameResolver,
|
||||
private readonly PhpDocTypeChanger $phpDocTypeChanger,
|
||||
private readonly TypeUnwrapper $typeUnwrapper
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNod
|
|||
final class StaticDoctrineAnnotationParser
|
||||
{
|
||||
public function __construct(
|
||||
private PlainValueParser $plainValueParser,
|
||||
private ArrayParser $arrayParser
|
||||
private readonly PlainValueParser $plainValueParser,
|
||||
private readonly ArrayParser $arrayParser
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ use Rector\BetterPhpDocParser\ValueObject\Parser\BetterTokenIterator;
|
|||
final class ArrayParser
|
||||
{
|
||||
public function __construct(
|
||||
private PlainValueParser $plainValueParser
|
||||
private readonly PlainValueParser $plainValueParser
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ final class PlainValueParser
|
|||
private ArrayParser $arrayParser;
|
||||
|
||||
public function __construct(
|
||||
private ClassAnnotationMatcher $classAnnotationMatcher,
|
||||
private CurrentNodeProvider $currentNodeProvider
|
||||
private readonly ClassAnnotationMatcher $classAnnotationMatcher,
|
||||
private readonly CurrentNodeProvider $currentNodeProvider
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -76,13 +76,13 @@ final class PhpDocInfoPrinter
|
|||
|
||||
private ?PhpDocInfo $phpDocInfo = null;
|
||||
|
||||
private PhpDocNodeTraverser $changedPhpDocNodeTraverser;
|
||||
private readonly PhpDocNodeTraverser $changedPhpDocNodeTraverser;
|
||||
|
||||
public function __construct(
|
||||
private EmptyPhpDocDetector $emptyPhpDocDetector,
|
||||
private DocBlockInliner $docBlockInliner,
|
||||
private RemoveNodesStartAndEndResolver $removeNodesStartAndEndResolver,
|
||||
private ChangedPhpDocNodeVisitor $changedPhpDocNodeVisitor,
|
||||
private readonly EmptyPhpDocDetector $emptyPhpDocDetector,
|
||||
private readonly DocBlockInliner $docBlockInliner,
|
||||
private readonly RemoveNodesStartAndEndResolver $removeNodesStartAndEndResolver,
|
||||
private readonly ChangedPhpDocNodeVisitor $changedPhpDocNodeVisitor,
|
||||
ChangedPhpDocNodeTraverserFactory $changedPhpDocNodeTraverserFactory
|
||||
) {
|
||||
$this->changedPhpDocNodeTraverser = $changedPhpDocNodeTraverserFactory->create();
|
||||
|
|
|
@ -20,7 +20,7 @@ final class BetterTokenIterator extends TokenIterator
|
|||
*/
|
||||
private const INDEX = 'index';
|
||||
|
||||
private PrivatesAccessor $privatesAccessor;
|
||||
private readonly PrivatesAccessor $privatesAccessor;
|
||||
|
||||
/**
|
||||
* @param array<int, mixed> $tokens
|
||||
|
|
|
@ -14,7 +14,7 @@ final class SpacingAwareTemplateTagValueNode extends TemplateTagValueNode implem
|
|||
string $name,
|
||||
?TypeNode $typeNode,
|
||||
string $description,
|
||||
private string $preposition
|
||||
private readonly string $preposition
|
||||
) {
|
||||
parent::__construct($name, $typeNode, $description);
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ use Rector\Core\Exception\ShouldNotHappenException;
|
|||
final class StartAndEnd
|
||||
{
|
||||
public function __construct(
|
||||
private int $start,
|
||||
private int $end
|
||||
private readonly int $start,
|
||||
private readonly int $end
|
||||
) {
|
||||
if ($end < $start) {
|
||||
throw new ShouldNotHappenException();
|
||||
|
|
|
@ -15,7 +15,7 @@ final class BracketsAwareUnionTypeNode extends UnionTypeNode implements Stringab
|
|||
*/
|
||||
public function __construct(
|
||||
array $types,
|
||||
private bool $isWrappedInBrackets = false
|
||||
private readonly bool $isWrappedInBrackets = false
|
||||
) {
|
||||
parent::__construct($types);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface;
|
|||
final class Cache
|
||||
{
|
||||
public function __construct(
|
||||
private CacheStorageInterface $cacheStorage
|
||||
private readonly CacheStorageInterface $cacheStorage
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ use Symplify\SmartFileSystem\SmartFileSystem;
|
|||
final class CacheFactory
|
||||
{
|
||||
public function __construct(
|
||||
private ParameterProvider $parameterProvider,
|
||||
private SmartFileSystem $smartFileSystem
|
||||
private readonly ParameterProvider $parameterProvider,
|
||||
private readonly SmartFileSystem $smartFileSystem
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
|||
final class ChangedFilesDetector
|
||||
{
|
||||
public function __construct(
|
||||
private FileHashComputer $fileHashComputer,
|
||||
private Cache $cache
|
||||
private readonly FileHashComputer $fileHashComputer,
|
||||
private readonly Cache $cache
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -13,9 +13,9 @@ use Symplify\PackageBuilder\Reflection\PrivatesAccessor;
|
|||
final class DependencyResolver
|
||||
{
|
||||
public function __construct(
|
||||
private NodeScopeResolver $nodeScopeResolver,
|
||||
private PHPStanDependencyResolver $phpStanDependencyResolver,
|
||||
private PrivatesAccessor $privatesAccessor
|
||||
private readonly NodeScopeResolver $nodeScopeResolver,
|
||||
private readonly PHPStanDependencyResolver $phpStanDependencyResolver,
|
||||
private readonly PrivatesAccessor $privatesAccessor
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
|||
final class UnchangedFilesFilter
|
||||
{
|
||||
public function __construct(
|
||||
private ChangedFilesDetector $changedFilesDetector
|
||||
private readonly ChangedFilesDetector $changedFilesDetector
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@ namespace Rector\Caching\ValueObject;
|
|||
final class CacheFilePaths
|
||||
{
|
||||
public function __construct(
|
||||
private string $firstDirectory,
|
||||
private string $secondDirectory,
|
||||
private string $filePath
|
||||
private readonly string $firstDirectory,
|
||||
private readonly string $secondDirectory,
|
||||
private readonly string $filePath
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ final class CacheItem
|
|||
* @param mixed $data
|
||||
*/
|
||||
public function __construct(
|
||||
private string $variableKey,
|
||||
private readonly string $variableKey,
|
||||
private $data
|
||||
) {
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ use Rector\Core\Contract\Rector\RectorInterface;
|
|||
final class RectorsChangelogResolver
|
||||
{
|
||||
public function __construct(
|
||||
private AnnotationExtractor $annotationExtractor
|
||||
private readonly AnnotationExtractor $annotationExtractor
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ use Rector\Core\ValueObject\Application\File;
|
|||
final class RectorChangeCollector
|
||||
{
|
||||
public function __construct(
|
||||
private CurrentRectorProvider $currentRectorProvider,
|
||||
private CurrentFileProvider $currentFileProvider
|
||||
private readonly CurrentRectorProvider $currentRectorProvider,
|
||||
private readonly CurrentFileProvider $currentFileProvider
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ final class ConsoleOutputFormatter implements OutputFormatterInterface
|
|||
private const ON_LINE_REGEX = '# on line #';
|
||||
|
||||
public function __construct(
|
||||
private OutputStyleInterface $outputStyle,
|
||||
private RectorsChangelogResolver $rectorsChangelogResolver
|
||||
private readonly OutputStyleInterface $outputStyle,
|
||||
private readonly RectorsChangelogResolver $rectorsChangelogResolver
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ final class JsonOutputFormatter implements OutputFormatterInterface
|
|||
public const NAME = 'json';
|
||||
|
||||
public function __construct(
|
||||
private RectorsChangelogResolver $rectorsChangelogResolver
|
||||
private readonly RectorsChangelogResolver $rectorsChangelogResolver
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -22,14 +22,14 @@ final class RectorWithLineChange implements SerializableInterface
|
|||
/**
|
||||
* @var class-string<RectorInterface>
|
||||
*/
|
||||
private string $rectorClass;
|
||||
private readonly string $rectorClass;
|
||||
|
||||
/**
|
||||
* @param class-string<RectorInterface>|RectorInterface $rectorClass
|
||||
*/
|
||||
public function __construct(
|
||||
string|RectorInterface $rectorClass,
|
||||
private int $line
|
||||
private readonly int $line
|
||||
) {
|
||||
if ($rectorClass instanceof RectorInterface) {
|
||||
$rectorClass = $rectorClass::class;
|
||||
|
|
|
@ -12,7 +12,7 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
|||
final class ErrorFactory
|
||||
{
|
||||
public function __construct(
|
||||
private ExceptionCorrector $exceptionCorrector
|
||||
private readonly ExceptionCorrector $exceptionCorrector
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ use Symplify\ConsoleColorDiff\Console\Output\ConsoleDiffer;
|
|||
final class FileDiffFactory
|
||||
{
|
||||
public function __construct(
|
||||
private DefaultDiffer $defaultDiffer,
|
||||
private ConsoleDiffer $consoleDiffer
|
||||
private readonly DefaultDiffer $defaultDiffer,
|
||||
private readonly ConsoleDiffer $consoleDiffer
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
|||
final class CommentRemover
|
||||
{
|
||||
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 function __construct(
|
||||
private PhpDocInfoPrinter $phpDocInfoPrinter
|
||||
private readonly PhpDocInfoPrinter $phpDocInfoPrinter
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
|
|||
final class FluentChainMethodCallNodeAnalyzer
|
||||
{
|
||||
public function __construct(
|
||||
private NodeNameResolver $nodeNameResolver,
|
||||
private NodeTypeResolver $nodeTypeResolver,
|
||||
private readonly NodeNameResolver $nodeNameResolver,
|
||||
private readonly NodeTypeResolver $nodeTypeResolver,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ use Rector\Core\Reflection\ReflectionResolver;
|
|||
final class SameClassMethodCallAnalyzer
|
||||
{
|
||||
public function __construct(
|
||||
private ReflectionResolver $reflectionResolver,
|
||||
private readonly ReflectionResolver $reflectionResolver,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ use Rector\FamilyTree\Reflection\FamilyRelationsAnalyzer;
|
|||
final class ClassChildAnalyzer
|
||||
{
|
||||
public function __construct(
|
||||
private FamilyRelationsAnalyzer $familyRelationsAnalyzer
|
||||
private readonly FamilyRelationsAnalyzer $familyRelationsAnalyzer
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -33,12 +33,12 @@ use Symplify\PackageBuilder\Reflection\PrivatesAccessor;
|
|||
final class FamilyRelationsAnalyzer
|
||||
{
|
||||
public function __construct(
|
||||
private ReflectionProvider $reflectionProvider,
|
||||
private PrivatesAccessor $privatesAccessor,
|
||||
private NodeNameResolver $nodeNameResolver,
|
||||
private BetterNodeFinder $betterNodeFinder,
|
||||
private StaticTypeMapper $staticTypeMapper,
|
||||
private AstResolver $astResolver,
|
||||
private readonly ReflectionProvider $reflectionProvider,
|
||||
private readonly PrivatesAccessor $privatesAccessor,
|
||||
private readonly NodeNameResolver $nodeNameResolver,
|
||||
private readonly BetterNodeFinder $betterNodeFinder,
|
||||
private readonly StaticTypeMapper $staticTypeMapper,
|
||||
private readonly AstResolver $astResolver,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ use PHPStan\Type\Type;
|
|||
final class PropertyType
|
||||
{
|
||||
public function __construct(
|
||||
private Type $varType,
|
||||
private Name|ComplexType|null $propertyTypeNode
|
||||
private readonly Type $varType,
|
||||
private readonly Name|ComplexType|null $propertyTypeNode
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ use Rector\FileFormatter\ValueObjectFactory\EditorConfigConfigurationBuilder;
|
|||
final class EditorConfigParser
|
||||
{
|
||||
public function __construct(
|
||||
private EditorConfig $editorConfig
|
||||
private readonly EditorConfig $editorConfig
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -22,9 +22,9 @@ final class FileFormatter
|
|||
* @param FileFormatterInterface[] $fileFormatters
|
||||
*/
|
||||
public function __construct(
|
||||
private EditorConfigParser $editorConfigParser,
|
||||
private ParameterProvider $parameterProvider,
|
||||
private array $fileFormatters = []
|
||||
private readonly EditorConfigParser $editorConfigParser,
|
||||
private readonly ParameterProvider $parameterProvider,
|
||||
private readonly array $fileFormatters = []
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ use Rector\FileFormatter\ValueObjectFactory\EditorConfigConfigurationBuilder;
|
|||
final class JsonFileFormatter implements FileFormatterInterface
|
||||
{
|
||||
public function __construct(
|
||||
private PrinterInterface $jsonPrinter
|
||||
private readonly PrinterInterface $jsonPrinter
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace Rector\FileFormatter\ValueObject;
|
|||
final class EditorConfigConfiguration
|
||||
{
|
||||
public function __construct(
|
||||
private Indent $indent,
|
||||
private NewLine $newLine,
|
||||
private bool $insertFinalNewline
|
||||
private readonly Indent $indent,
|
||||
private readonly NewLine $newLine,
|
||||
private readonly bool $insertFinalNewline
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ final class Indent implements Stringable
|
|||
private const PARSE_INDENT_REGEX = '/^(?P<indent>( +|\t+)).*/m';
|
||||
|
||||
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 function __construct(
|
||||
private string $string
|
||||
private readonly string $string
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
|||
final class FileInfoParser
|
||||
{
|
||||
public function __construct(
|
||||
private NodeScopeAndMetadataDecorator $nodeScopeAndMetadataDecorator,
|
||||
private RectorParser $rectorParser
|
||||
private readonly NodeScopeAndMetadataDecorator $nodeScopeAndMetadataDecorator,
|
||||
private readonly RectorParser $rectorParser
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ use Rector\FileSystemRector\Contract\AddedFileInterface;
|
|||
final class AddedFileWithContent implements AddedFileInterface
|
||||
{
|
||||
public function __construct(
|
||||
private string $filePath,
|
||||
private string $fileContent
|
||||
private readonly string $filePath,
|
||||
private readonly string $fileContent
|
||||
) {
|
||||
if ($filePath === $fileContent) {
|
||||
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
|
||||
*/
|
||||
public function __construct(
|
||||
private string $filePath,
|
||||
private array $nodes
|
||||
private readonly string $filePath,
|
||||
private readonly array $nodes
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -22,11 +22,11 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
|||
final class AddedFileWithNodesFactory
|
||||
{
|
||||
public function __construct(
|
||||
private BetterNodeFinder $betterNodeFinder,
|
||||
private CategoryNamespaceProvider $categoryNamespaceProvider,
|
||||
private FileRelocationResolver $fileRelocationResolver,
|
||||
private RenamedClassesDataCollector $renamedClassesDataCollector,
|
||||
private FileInfoDeletionAnalyzer $fileInfoDeletionAnalyzer
|
||||
private readonly BetterNodeFinder $betterNodeFinder,
|
||||
private readonly CategoryNamespaceProvider $categoryNamespaceProvider,
|
||||
private readonly FileRelocationResolver $fileRelocationResolver,
|
||||
private readonly RenamedClassesDataCollector $renamedClassesDataCollector,
|
||||
private readonly FileInfoDeletionAnalyzer $fileInfoDeletionAnalyzer
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -31,11 +31,11 @@ use Rector\NodeTypeResolver\NodeTypeResolver;
|
|||
final class ArrayCallableMethodMatcher
|
||||
{
|
||||
public function __construct(
|
||||
private NodeNameResolver $nodeNameResolver,
|
||||
private NodeTypeResolver $nodeTypeResolver,
|
||||
private ValueResolver $valueResolver,
|
||||
private ReflectionProvider $reflectionProvider,
|
||||
private BetterNodeFinder $betterNodeFinder,
|
||||
private readonly NodeNameResolver $nodeNameResolver,
|
||||
private readonly NodeTypeResolver $nodeTypeResolver,
|
||||
private readonly ValueResolver $valueResolver,
|
||||
private readonly ReflectionProvider $reflectionProvider,
|
||||
private readonly BetterNodeFinder $betterNodeFinder,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ use Rector\Core\Util\StringUtils;
|
|||
final class StaticAnalyzer
|
||||
{
|
||||
public function __construct(
|
||||
private ReflectionProvider $reflectionProvider
|
||||
private readonly ReflectionProvider $reflectionProvider
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ use PhpParser\Node\Expr;
|
|||
final class ArrayCallable
|
||||
{
|
||||
public function __construct(
|
||||
private Expr $callerExpr,
|
||||
private string $class,
|
||||
private string $method
|
||||
private readonly Expr $callerExpr,
|
||||
private readonly string $class,
|
||||
private readonly string $method
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ use PhpParser\Node\Expr;
|
|||
final class ArrayCallableDynamicMethod
|
||||
{
|
||||
public function __construct(
|
||||
private Expr $callerExpr,
|
||||
private string $class,
|
||||
private Expr $method
|
||||
private readonly Expr $callerExpr,
|
||||
private readonly string $class,
|
||||
private readonly Expr $method
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ final class InvalidNameNodeReporter
|
|||
private const FILE = 'file';
|
||||
|
||||
public function __construct(
|
||||
private CurrentFileProvider $currentFileProvider,
|
||||
private BetterStandardPrinter $betterStandardPrinter
|
||||
private readonly CurrentFileProvider $currentFileProvider,
|
||||
private readonly BetterStandardPrinter $betterStandardPrinter
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -27,11 +27,11 @@ final class NodeNameResolver
|
|||
* @param NodeNameResolverInterface[] $nodeNameResolvers
|
||||
*/
|
||||
public function __construct(
|
||||
private RegexPatternDetector $regexPatternDetector,
|
||||
private ClassNaming $classNaming,
|
||||
private InvalidNameNodeReporter $invalidNameNodeReporter,
|
||||
private CallAnalyzer $callAnalyzer,
|
||||
private array $nodeNameResolvers = []
|
||||
private readonly RegexPatternDetector $regexPatternDetector,
|
||||
private readonly ClassNaming $classNaming,
|
||||
private readonly InvalidNameNodeReporter $invalidNameNodeReporter,
|
||||
private readonly CallAnalyzer $callAnalyzer,
|
||||
private readonly array $nodeNameResolvers = []
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
|||
final class FuncCallNameResolver implements NodeNameResolverInterface
|
||||
{
|
||||
public function __construct(
|
||||
private ReflectionProvider $reflectionProvider
|
||||
private readonly ReflectionProvider $reflectionProvider
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
|||
final class NameNameResolver implements NodeNameResolverInterface
|
||||
{
|
||||
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];
|
||||
|
||||
public function __construct(
|
||||
private BetterNodeFinder $betterNodeFinder,
|
||||
private NodeTypeResolver $nodeTypeResolver,
|
||||
private readonly BetterNodeFinder $betterNodeFinder,
|
||||
private readonly NodeTypeResolver $nodeTypeResolver,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ final class ScopeAwareNodeFinder
|
|||
private bool $isBreakingNodeFoundFirst = false;
|
||||
|
||||
public function __construct(
|
||||
private BetterNodeFinder $betterNodeFinder
|
||||
private readonly BetterNodeFinder $betterNodeFinder
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
|||
final class ParentScopeFinder
|
||||
{
|
||||
public function __construct(
|
||||
private BetterNodeFinder $betterNodeFinder,
|
||||
private readonly BetterNodeFinder $betterNodeFinder,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ final class ScopeNestingComparator
|
|||
private array $doubleIfBranchExprs = [];
|
||||
|
||||
public function __construct(
|
||||
private BetterNodeFinder $betterNodeFinder,
|
||||
private NodeComparator $nodeComparator,
|
||||
private readonly BetterNodeFinder $betterNodeFinder,
|
||||
private readonly NodeComparator $nodeComparator,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@ use Rector\PostRector\Collector\NodesToReplaceCollector;
|
|||
final class AssignRemover
|
||||
{
|
||||
public function __construct(
|
||||
private NodesToReplaceCollector $nodesToReplaceCollector,
|
||||
private RectorChangeCollector $rectorChangeCollector,
|
||||
private NodeRemover $nodeRemover,
|
||||
private LivingCodeManipulator $livingCodeManipulator
|
||||
private readonly NodesToReplaceCollector $nodesToReplaceCollector,
|
||||
private readonly RectorChangeCollector $rectorChangeCollector,
|
||||
private readonly NodeRemover $nodeRemover,
|
||||
private readonly LivingCodeManipulator $livingCodeManipulator
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ use Rector\PostRector\Collector\NodesToRemoveCollector;
|
|||
final class NodeRemover
|
||||
{
|
||||
public function __construct(
|
||||
private NodesToRemoveCollector $nodesToRemoveCollector,
|
||||
private RectorChangeCollector $rectorChangeCollector
|
||||
private readonly NodesToRemoveCollector $nodesToRemoveCollector,
|
||||
private readonly RectorChangeCollector $rectorChangeCollector
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ use Symplify\PackageBuilder\Parameter\ParameterProvider;
|
|||
*/
|
||||
final class PHPStanServicesFactory
|
||||
{
|
||||
private Container $container;
|
||||
private readonly Container $container;
|
||||
|
||||
public function __construct(ParameterProvider $parameterProvider)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ use Rector\Core\Reflection\ReflectionResolver;
|
|||
final class MethodParameterTypeResolver
|
||||
{
|
||||
public function __construct(
|
||||
private ReflectionResolver $reflectionResolver,
|
||||
private readonly ReflectionResolver $reflectionResolver,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -17,12 +17,12 @@ use Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver;
|
|||
final class NodeScopeAndMetadataDecorator
|
||||
{
|
||||
public function __construct(
|
||||
private CloningVisitor $cloningVisitor,
|
||||
private NamespaceNodeVisitor $namespaceNodeVisitor,
|
||||
private PHPStanNodeScopeResolver $phpStanNodeScopeResolver,
|
||||
private StatementNodeVisitor $statementNodeVisitor,
|
||||
private NodeConnectingVisitor $nodeConnectingVisitor,
|
||||
private FunctionLikeParamArgPositionNodeVisitor $functionLikeParamArgPositionNodeVisitor
|
||||
private readonly CloningVisitor $cloningVisitor,
|
||||
private readonly NamespaceNodeVisitor $namespaceNodeVisitor,
|
||||
private readonly PHPStanNodeScopeResolver $phpStanNodeScopeResolver,
|
||||
private readonly StatementNodeVisitor $statementNodeVisitor,
|
||||
private readonly NodeConnectingVisitor $nodeConnectingVisitor,
|
||||
private readonly FunctionLikeParamArgPositionNodeVisitor $functionLikeParamArgPositionNodeVisitor
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ use PHPStan\Type\TypeTraverser;
|
|||
final class GenericClassStringTypeCorrector
|
||||
{
|
||||
public function __construct(
|
||||
private ReflectionProvider $reflectionProvider
|
||||
private readonly ReflectionProvider $reflectionProvider
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -21,11 +21,11 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
|||
final class PregMatchTypeCorrector
|
||||
{
|
||||
public function __construct(
|
||||
private BetterNodeFinder $betterNodeFinder,
|
||||
private NodeNameResolver $nodeNameResolver,
|
||||
private ParentScopeFinder $parentScopeFinder,
|
||||
private NodeComparator $nodeComparator,
|
||||
private ArgsAnalyzer $argsAnalyzer
|
||||
private readonly BetterNodeFinder $betterNodeFinder,
|
||||
private readonly NodeNameResolver $nodeNameResolver,
|
||||
private readonly ParentScopeFinder $parentScopeFinder,
|
||||
private readonly NodeComparator $nodeComparator,
|
||||
private readonly ArgsAnalyzer $argsAnalyzer
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -57,15 +57,15 @@ final class NodeTypeResolver
|
|||
* @param NodeTypeResolverInterface[] $nodeTypeResolvers
|
||||
*/
|
||||
public function __construct(
|
||||
private ObjectTypeSpecifier $objectTypeSpecifier,
|
||||
private ClassAnalyzer $classAnalyzer,
|
||||
private GenericClassStringTypeCorrector $genericClassStringTypeCorrector,
|
||||
private ReflectionProvider $reflectionProvider,
|
||||
private HasOffsetTypeCorrector $hasOffsetTypeCorrector,
|
||||
private AccessoryNonEmptyStringTypeCorrector $accessoryNonEmptyStringTypeCorrector,
|
||||
private IdentifierTypeResolver $identifierTypeResolver,
|
||||
private RenamedClassesDataCollector $renamedClassesDataCollector,
|
||||
private BetterNodeFinder $betterNodeFinder,
|
||||
private readonly ObjectTypeSpecifier $objectTypeSpecifier,
|
||||
private readonly ClassAnalyzer $classAnalyzer,
|
||||
private readonly GenericClassStringTypeCorrector $genericClassStringTypeCorrector,
|
||||
private readonly ReflectionProvider $reflectionProvider,
|
||||
private readonly HasOffsetTypeCorrector $hasOffsetTypeCorrector,
|
||||
private readonly AccessoryNonEmptyStringTypeCorrector $accessoryNonEmptyStringTypeCorrector,
|
||||
private readonly IdentifierTypeResolver $identifierTypeResolver,
|
||||
private readonly RenamedClassesDataCollector $renamedClassesDataCollector,
|
||||
private readonly BetterNodeFinder $betterNodeFinder,
|
||||
array $nodeTypeResolvers
|
||||
) {
|
||||
foreach ($nodeTypeResolvers as $nodeTypeResolver) {
|
||||
|
|
|
@ -25,7 +25,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
|||
final class ClassAndInterfaceTypeResolver implements NodeTypeResolverInterface
|
||||
{
|
||||
public function __construct(
|
||||
private NodeNameResolver $nodeNameResolver
|
||||
private readonly NodeNameResolver $nodeNameResolver
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ final class ClassMethodOrClassConstTypeResolver implements NodeTypeResolverInter
|
|||
private NodeTypeResolver $nodeTypeResolver;
|
||||
|
||||
public function __construct(
|
||||
private BetterNodeFinder $betterNodeFinder
|
||||
private readonly BetterNodeFinder $betterNodeFinder
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
|||
final class NameTypeResolver implements NodeTypeResolverInterface
|
||||
{
|
||||
public function __construct(
|
||||
private ReflectionProvider $reflectionProvider,
|
||||
private BetterNodeFinder $betterNodeFinder,
|
||||
private NodeNameResolver $nodeNameResolver
|
||||
private readonly ReflectionProvider $reflectionProvider,
|
||||
private readonly BetterNodeFinder $betterNodeFinder,
|
||||
private readonly NodeNameResolver $nodeNameResolver
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
|
|||
final class NewTypeResolver implements NodeTypeResolverInterface
|
||||
{
|
||||
public function __construct(
|
||||
private NodeNameResolver $nodeNameResolver,
|
||||
private ClassAnalyzer $classAnalyzer,
|
||||
private readonly NodeNameResolver $nodeNameResolver,
|
||||
private readonly ClassAnalyzer $classAnalyzer,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -37,10 +37,10 @@ final class ParamTypeResolver implements NodeTypeResolverInterface
|
|||
private StaticTypeMapper $staticTypeMapper;
|
||||
|
||||
public function __construct(
|
||||
private SimpleCallableNodeTraverser $simpleCallableNodeTraverser,
|
||||
private NodeNameResolver $nodeNameResolver,
|
||||
private PhpDocInfoFactory $phpDocInfoFactory,
|
||||
private BetterNodeFinder $betterNodeFinder,
|
||||
private readonly SimpleCallableNodeTraverser $simpleCallableNodeTraverser,
|
||||
private readonly NodeNameResolver $nodeNameResolver,
|
||||
private readonly PhpDocInfoFactory $phpDocInfoFactory,
|
||||
private readonly BetterNodeFinder $betterNodeFinder,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ final class PropertyFetchTypeResolver implements NodeTypeResolverInterface
|
|||
private NodeTypeResolver $nodeTypeResolver;
|
||||
|
||||
public function __construct(
|
||||
private NodeNameResolver $nodeNameResolver,
|
||||
private ReflectionProvider $reflectionProvider,
|
||||
private BetterNodeFinder $betterNodeFinder
|
||||
private readonly NodeNameResolver $nodeNameResolver,
|
||||
private readonly ReflectionProvider $reflectionProvider,
|
||||
private readonly BetterNodeFinder $betterNodeFinder
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ final class StaticCallMethodCallTypeResolver implements NodeTypeResolverInterfac
|
|||
private NodeTypeResolver $nodeTypeResolver;
|
||||
|
||||
public function __construct(
|
||||
private NodeNameResolver $nodeNameResolver,
|
||||
private ReflectionProvider $reflectionProvider
|
||||
private readonly NodeNameResolver $nodeNameResolver,
|
||||
private readonly ReflectionProvider $reflectionProvider
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ use Rector\NodeTypeResolver\Contract\NodeTypeResolverInterface;
|
|||
final class TraitTypeResolver implements NodeTypeResolverInterface
|
||||
{
|
||||
public function __construct(
|
||||
private ReflectionProvider $reflectionProvider
|
||||
private readonly ReflectionProvider $reflectionProvider
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
|||
final class VariableTypeResolver implements NodeTypeResolverInterface
|
||||
{
|
||||
public function __construct(
|
||||
private NodeNameResolver $nodeNameResolver,
|
||||
private PhpDocInfoFactory $phpDocInfoFactory
|
||||
private readonly NodeNameResolver $nodeNameResolver,
|
||||
private readonly PhpDocInfoFactory $phpDocInfoFactory
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ final class NamespaceNodeVisitor extends NodeVisitorAbstract
|
|||
private array $useNodes = [];
|
||||
|
||||
public function __construct(
|
||||
private BetterNodeFinder $betterNodeFinder
|
||||
private readonly BetterNodeFinder $betterNodeFinder
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -19,12 +19,12 @@ use Symplify\PackageBuilder\Parameter\ParameterProvider;
|
|||
*/
|
||||
final class RemoveDeepChainMethodCallNodeVisitor extends NodeVisitorAbstract
|
||||
{
|
||||
private int $nestedChainMethodCallLimit;
|
||||
private readonly int $nestedChainMethodCallLimit;
|
||||
|
||||
private ?Expression $removingExpression = null;
|
||||
|
||||
public function __construct(
|
||||
private BetterNodeFinder $betterNodeFinder,
|
||||
private readonly BetterNodeFinder $betterNodeFinder,
|
||||
ParameterProvider $parameterProvider
|
||||
) {
|
||||
$this->nestedChainMethodCallLimit = (int) $parameterProvider->provideParameter(
|
||||
|
|
|
@ -47,16 +47,16 @@ final class PHPStanNodeScopeResolver
|
|||
private const CONTEXT = 'context';
|
||||
|
||||
public function __construct(
|
||||
private ChangedFilesDetector $changedFilesDetector,
|
||||
private DependencyResolver $dependencyResolver,
|
||||
private NodeScopeResolver $nodeScopeResolver,
|
||||
private ReflectionProvider $reflectionProvider,
|
||||
private RemoveDeepChainMethodCallNodeVisitor $removeDeepChainMethodCallNodeVisitor,
|
||||
private ScopeFactory $scopeFactory,
|
||||
private PrivatesAccessor $privatesAccessor,
|
||||
private RenamedClassesSourceLocator $renamedClassesSourceLocator,
|
||||
private ParentAttributeSourceLocator $parentAttributeSourceLocator,
|
||||
private TraitScopeFaker $traitScopeFaker,
|
||||
private readonly ChangedFilesDetector $changedFilesDetector,
|
||||
private readonly DependencyResolver $dependencyResolver,
|
||||
private readonly NodeScopeResolver $nodeScopeResolver,
|
||||
private readonly ReflectionProvider $reflectionProvider,
|
||||
private readonly RemoveDeepChainMethodCallNodeVisitor $removeDeepChainMethodCallNodeVisitor,
|
||||
private readonly ScopeFactory $scopeFactory,
|
||||
private readonly PrivatesAccessor $privatesAccessor,
|
||||
private readonly RenamedClassesSourceLocator $renamedClassesSourceLocator,
|
||||
private readonly ParentAttributeSourceLocator $parentAttributeSourceLocator,
|
||||
private readonly TraitScopeFaker $traitScopeFaker,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
|||
final class ScopeFactory
|
||||
{
|
||||
public function __construct(
|
||||
private PHPStanScopeFactory $phpStanScopeFactory
|
||||
private readonly PHPStanScopeFactory $phpStanScopeFactory
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ use Symplify\PackageBuilder\Reflection\PrivatesAccessor;
|
|||
final class TraitScopeFaker
|
||||
{
|
||||
public function __construct(
|
||||
private PrivatesAccessor $privatesAccessor,
|
||||
private ReflectionProvider $reflectionProvider
|
||||
private readonly PrivatesAccessor $privatesAccessor,
|
||||
private readonly ReflectionProvider $reflectionProvider
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ use Rector\PHPStanStaticTypeMapper\TypeAnalyzer\UnionTypeAnalyzer;
|
|||
final class StaticTypeAnalyzer
|
||||
{
|
||||
public function __construct(
|
||||
private UnionTypeAnalyzer $unionTypeAnalyzer
|
||||
private readonly UnionTypeAnalyzer $unionTypeAnalyzer
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ use Rector\NodeTypeResolver\PHPStan\TypeHasher;
|
|||
final class TypeFactory
|
||||
{
|
||||
public function __construct(
|
||||
private TypeHasher $typeHasher,
|
||||
private readonly TypeHasher $typeHasher,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ use Rector\NodeTypeResolver\ValueObject\OldToNewType;
|
|||
final class DocBlockClassRenamer
|
||||
{
|
||||
public function __construct(
|
||||
private ClassRenamePhpDocNodeVisitor $classRenamePhpDocNodeVisitor,
|
||||
private RenamingPhpDocNodeVisitorFactory $renamingPhpDocNodeVisitorFactory
|
||||
private readonly ClassRenamePhpDocNodeVisitor $classRenamePhpDocNodeVisitor,
|
||||
private readonly RenamingPhpDocNodeVisitorFactory $renamingPhpDocNodeVisitorFactory
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ use Rector\NodeTypeResolver\PhpDocNodeVisitor\NameImportingPhpDocNodeVisitor;
|
|||
final class DocBlockNameImporter
|
||||
{
|
||||
public function __construct(
|
||||
private NameImportingPhpDocNodeVisitor $nameImportingPhpDocNodeVisitor,
|
||||
private ImportingPhpDocNodeTraverserFactory $importingPhpDocNodeTraverserFactory
|
||||
private readonly NameImportingPhpDocNodeVisitor $nameImportingPhpDocNodeVisitor,
|
||||
private readonly ImportingPhpDocNodeTraverserFactory $importingPhpDocNodeTraverserFactory
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
|||
final class DocBlockTagReplacer
|
||||
{
|
||||
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