Updated Rector to commit 4680c56d005b2dfade49fa14144e75862a9a8b1f

4680c56d00 Bump Rector package deps (#1087)
This commit is contained in:
Tomas Votruba 2021-10-27 23:25:15 +00:00
parent 2e2f586bf9
commit 0c54ea5aa9
43 changed files with 150 additions and 121 deletions

View File

@ -30,5 +30,7 @@
"rector/rector-cakephp": "*", "rector/rector-cakephp": "*",
"rector/rector-laravel": "*", "rector/rector-laravel": "*",
"rector/rector-phpoffice": "*" "rector/rector-phpoffice": "*"
} },
"minimum-stability": "dev",
"prefer-stable": true
} }

View File

@ -15,7 +15,7 @@ final class PropertyType
*/ */
private $varType; private $varType;
/** /**
* @var \PhpParser\Node\Name|\PhpParser\Node\NullableType|PhpParserUnionType|null * @var Name|NullableType|PhpParserUnionType|null
*/ */
private $propertyTypeNode; private $propertyTypeNode;
/** /**

View File

@ -65,7 +65,7 @@ final class NodeNameResolver
return \false; return \false;
} }
/** /**
* @param Node|Node[] $node * @param \PhpParser\Node|mixed[] $node
*/ */
public function isName($node, string $name) : bool public function isName($node, string $name) : bool
{ {

View File

@ -27,7 +27,7 @@ final class ClassAndInterfaceTypeResolver implements \Rector\NodeTypeResolver\Co
return [\PhpParser\Node\Stmt\Class_::class, \PhpParser\Node\Stmt\Interface_::class]; return [\PhpParser\Node\Stmt\Class_::class, \PhpParser\Node\Stmt\Interface_::class];
} }
/** /**
* @param Class_|Interface_ $node * @param \PhpParser\Node $node
*/ */
public function resolve($node) : \PHPStan\Type\Type public function resolve($node) : \PHPStan\Type\Type
{ {

View File

@ -35,7 +35,7 @@ final class ClassMethodOrClassConstTypeResolver implements \Rector\NodeTypeResol
return [\PhpParser\Node\Stmt\ClassMethod::class, \PhpParser\Node\Stmt\ClassConst::class]; return [\PhpParser\Node\Stmt\ClassMethod::class, \PhpParser\Node\Stmt\ClassConst::class];
} }
/** /**
* @param ClassMethod|ClassConst $node * @param \PhpParser\Node $node
*/ */
public function resolve($node) : \PHPStan\Type\Type public function resolve($node) : \PHPStan\Type\Type
{ {

View File

@ -51,7 +51,7 @@ final class StaticCallMethodCallTypeResolver implements \Rector\NodeTypeResolver
return [\PhpParser\Node\Expr\StaticCall::class, \PhpParser\Node\Expr\MethodCall::class]; return [\PhpParser\Node\Expr\StaticCall::class, \PhpParser\Node\Expr\MethodCall::class];
} }
/** /**
* @param StaticCall|MethodCall $node * @param \PhpParser\Node $node
*/ */
public function resolve($node) : \PHPStan\Type\Type public function resolve($node) : \PHPStan\Type\Type
{ {

View File

@ -11,28 +11,28 @@ use PHPStan\Type\Constant\ConstantFloatType;
use PHPStan\Type\Constant\ConstantIntegerType; use PHPStan\Type\Constant\ConstantIntegerType;
use PHPStan\Type\Constant\ConstantStringType; use PHPStan\Type\Constant\ConstantStringType;
use PHPStan\Type\FloatType; use PHPStan\Type\FloatType;
use PHPStan\Type\Generic\GenericObjectType;
use PHPStan\Type\IntegerType; use PHPStan\Type\IntegerType;
use PHPStan\Type\MixedType; use PHPStan\Type\MixedType;
use PHPStan\Type\ObjectType;
use PHPStan\Type\StringType; use PHPStan\Type\StringType;
use PHPStan\Type\Type; use PHPStan\Type\Type;
use PHPStan\Type\TypeTraverser;
use PHPStan\Type\TypeUtils; use PHPStan\Type\TypeUtils;
use PHPStan\Type\VerbosityLevel; use Rector\NodeTypeResolver\PHPStan\TypeHasher;
use Rector\StaticTypeMapper\TypeFactory\UnionTypeFactory; use Rector\StaticTypeMapper\TypeFactory\UnionTypeFactory;
use Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType;
use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType; use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
use Rector\StaticTypeMapper\ValueObject\Type\ShortenedObjectType;
final class TypeFactory final class TypeFactory
{ {
/** /**
* @var \Rector\StaticTypeMapper\TypeFactory\UnionTypeFactory * @var \Rector\StaticTypeMapper\TypeFactory\UnionTypeFactory
*/ */
private $unionTypeFactory; private $unionTypeFactory;
public function __construct(\Rector\StaticTypeMapper\TypeFactory\UnionTypeFactory $unionTypeFactory) /**
* @var \Rector\NodeTypeResolver\PHPStan\TypeHasher
*/
private $typeHasher;
public function __construct(\Rector\StaticTypeMapper\TypeFactory\UnionTypeFactory $unionTypeFactory, \Rector\NodeTypeResolver\PHPStan\TypeHasher $typeHasher)
{ {
$this->unionTypeFactory = $unionTypeFactory; $this->unionTypeFactory = $unionTypeFactory;
$this->typeHasher = $typeHasher;
} }
/** /**
* @param Type[] $types * @param Type[] $types
@ -64,8 +64,7 @@ final class TypeFactory
if (!$keepConstant) { if (!$keepConstant) {
$type = $this->removeValueFromConstantType($type); $type = $this->removeValueFromConstantType($type);
} }
$type = $this->normalizeObjectTypes($type); $typeHash = $this->typeHasher->createTypeHash($type);
$typeHash = $type->describe(\PHPStan\Type\VerbosityLevel::cache());
$uniqueTypes[$typeHash] = $type; $uniqueTypes[$typeHash] = $type;
} }
// re-index // re-index
@ -151,16 +150,4 @@ final class TypeFactory
} }
return $unwrappedTypes; return $unwrappedTypes;
} }
private function normalizeObjectTypes(\PHPStan\Type\Type $type) : \PHPStan\Type\Type
{
return \PHPStan\Type\TypeTraverser::map($type, function (\PHPStan\Type\Type $currentType, callable $traverseCallback) : Type {
if ($currentType instanceof \Rector\StaticTypeMapper\ValueObject\Type\ShortenedObjectType) {
return new \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType($currentType->getFullyQualifiedName());
}
if ($currentType instanceof \PHPStan\Type\ObjectType && !$currentType instanceof \PHPStan\Type\Generic\GenericObjectType && !$currentType instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType && $currentType->getClassName() !== 'Iterator') {
return new \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType($currentType->getClassName());
}
return $traverseCallback($currentType);
});
}
} }

View File

@ -7,7 +7,9 @@ use PHPStan\Type\ArrayType;
use PHPStan\Type\BooleanType; use PHPStan\Type\BooleanType;
use PHPStan\Type\ConstantType; use PHPStan\Type\ConstantType;
use PHPStan\Type\Generic\GenericObjectType; use PHPStan\Type\Generic\GenericObjectType;
use PHPStan\Type\IterableType;
use PHPStan\Type\MixedType; use PHPStan\Type\MixedType;
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type; use PHPStan\Type\Type;
use PHPStan\Type\TypeTraverser; use PHPStan\Type\TypeTraverser;
use PHPStan\Type\TypeWithClassName; use PHPStan\Type\TypeWithClassName;
@ -23,7 +25,7 @@ final class TypeHasher
{ {
return $this->createTypeHash($firstType) === $this->createTypeHash($secondType); return $this->createTypeHash($firstType) === $this->createTypeHash($secondType);
} }
private function createTypeHash(\PHPStan\Type\Type $type) : string public function createTypeHash(\PHPStan\Type\Type $type) : string
{ {
if ($type instanceof \PHPStan\Type\MixedType) { if ($type instanceof \PHPStan\Type\MixedType) {
return \serialize($type) . $type->isExplicitMixed(); return \serialize($type) . $type->isExplicitMixed();
@ -43,6 +45,17 @@ final class TypeHasher
if ($type instanceof \PHPStan\Type\UnionType) { if ($type instanceof \PHPStan\Type\UnionType) {
return $this->createUnionTypeHash($type); return $this->createUnionTypeHash($type);
} }
$type = $this->normalizeObjectType($type);
// normalize iterable
$type = \PHPStan\Type\TypeTraverser::map($type, function (\PHPStan\Type\Type $currentType, callable $traverseCallback) : Type {
if (!$currentType instanceof \PHPStan\Type\ObjectType) {
return $traverseCallback($currentType);
}
if ($currentType->getClassName() === 'iterable') {
return new \PHPStan\Type\IterableType(new \PHPStan\Type\MixedType(), new \PHPStan\Type\MixedType());
}
return $traverseCallback($currentType);
});
return $type->describe(\PHPStan\Type\VerbosityLevel::value()); return $type->describe(\PHPStan\Type\VerbosityLevel::value());
} }
private function resolveUniqueTypeWithClassNameHash(\PHPStan\Type\TypeWithClassName $typeWithClassName) : string private function resolveUniqueTypeWithClassNameHash(\PHPStan\Type\TypeWithClassName $typeWithClassName) : string
@ -51,7 +64,7 @@ final class TypeHasher
return $typeWithClassName->getFullyQualifiedName(); return $typeWithClassName->getFullyQualifiedName();
} }
if ($typeWithClassName instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType) { if ($typeWithClassName instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType) {
return $typeWithClassName->getFullyQualifiedClass(); return $typeWithClassName->getFullyQualifiedName();
} }
return $typeWithClassName->getClassName(); return $typeWithClassName->getClassName();
} }
@ -66,11 +79,26 @@ final class TypeHasher
$normalizedUnionType = clone $sortedUnionType; $normalizedUnionType = clone $sortedUnionType;
// change alias to non-alias // change alias to non-alias
$normalizedUnionType = \PHPStan\Type\TypeTraverser::map($normalizedUnionType, function (\PHPStan\Type\Type $type, callable $callable) : Type { $normalizedUnionType = \PHPStan\Type\TypeTraverser::map($normalizedUnionType, function (\PHPStan\Type\Type $type, callable $callable) : Type {
if (!$type instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType) { if (!$type instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType && !$type instanceof \Rector\StaticTypeMapper\ValueObject\Type\ShortenedObjectType) {
return $callable($type); return $callable($type);
} }
return new \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType($type->getFullyQualifiedClass()); return new \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType($type->getFullyQualifiedName());
}); });
return $normalizedUnionType->describe(\PHPStan\Type\VerbosityLevel::precise()); return $normalizedUnionType->describe(\PHPStan\Type\VerbosityLevel::precise());
} }
private function normalizeObjectType(\PHPStan\Type\Type $type) : \PHPStan\Type\Type
{
return \PHPStan\Type\TypeTraverser::map($type, function (\PHPStan\Type\Type $currentType, callable $traverseCallback) : Type {
if ($currentType instanceof \Rector\StaticTypeMapper\ValueObject\Type\ShortenedObjectType) {
return new \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType($currentType->getFullyQualifiedName());
}
if ($currentType instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType) {
return new \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType($currentType->getFullyQualifiedName());
}
if ($currentType instanceof \PHPStan\Type\ObjectType && !$currentType instanceof \PHPStan\Type\Generic\GenericObjectType && !$currentType instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType && $currentType->getClassName() !== 'Iterator' && $currentType->getClassName() !== 'iterable') {
return new \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType($currentType->getClassName());
}
return $traverseCallback($currentType);
});
}
} }

View File

@ -57,6 +57,11 @@ final class TypeComparator
} }
public function areTypesEqual(\PHPStan\Type\Type $firstType, \PHPStan\Type\Type $secondType) : bool public function areTypesEqual(\PHPStan\Type\Type $firstType, \PHPStan\Type\Type $secondType) : bool
{ {
$firstTypeHash = $this->typeHasher->createTypeHash($firstType);
$secondTypeHash = $this->typeHasher->createTypeHash($secondType);
if ($firstTypeHash === $secondTypeHash) {
return \true;
}
if ($this->scalarTypeComparator->areEqualScalar($firstType, $secondType)) { if ($this->scalarTypeComparator->areEqualScalar($firstType, $secondType)) {
return \true; return \true;
} }
@ -99,8 +104,7 @@ final class TypeComparator
} }
private function areAliasedObjectMatchingFqnObject(\PHPStan\Type\Type $firstType, \PHPStan\Type\Type $secondType) : bool private function areAliasedObjectMatchingFqnObject(\PHPStan\Type\Type $firstType, \PHPStan\Type\Type $secondType) : bool
{ {
if ($firstType instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType && $secondType instanceof \PHPStan\Type\ObjectType && $firstType->getFullyQualifiedClass() === $secondType->getClassName()) { if ($firstType instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType && $secondType instanceof \PHPStan\Type\ObjectType && $firstType->getFullyQualifiedName() === $secondType->getClassName()) {
return \true;
} }
if (!$secondType instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType) { if (!$secondType instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType) {
return \false; return \false;
@ -108,7 +112,7 @@ final class TypeComparator
if (!$firstType instanceof \PHPStan\Type\ObjectType) { if (!$firstType instanceof \PHPStan\Type\ObjectType) {
return \false; return \false;
} }
return $secondType->getFullyQualifiedClass() === $firstType->getClassName(); return $secondType->getFullyQualifiedName() === $firstType->getClassName();
} }
/** /**
* E.g. class A extends B, class B A[] is subtype of B[] keep A[] * E.g. class A extends B, class B A[] is subtype of B[] keep A[]

View File

@ -48,7 +48,7 @@ final class CallableTypeMapper implements \Rector\PHPStanStaticTypeMapper\Contra
return new \Rector\BetterPhpDocParser\ValueObject\Type\SpacingAwareCallableTypeNode(new \PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode('callable'), [], $returnTypeNode); return new \Rector\BetterPhpDocParser\ValueObject\Type\SpacingAwareCallableTypeNode(new \PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode('callable'), [], $returnTypeNode);
} }
/** /**
* @param CallableType|ClosureType $type * @param \PHPStan\Type\Type $type
* @param \Rector\PHPStanStaticTypeMapper\Enum\TypeKind $typeKind * @param \Rector\PHPStanStaticTypeMapper\Enum\TypeKind $typeKind
*/ */
public function mapToPhpParserNode($type, $typeKind) : ?\PhpParser\Node public function mapToPhpParserNode($type, $typeKind) : ?\PhpParser\Node

View File

@ -21,7 +21,7 @@ final class AliasedObjectType extends \PHPStan\Type\ObjectType
$this->fullyQualifiedClass = $fullyQualifiedClass; $this->fullyQualifiedClass = $fullyQualifiedClass;
parent::__construct($alias); parent::__construct($alias);
} }
public function getFullyQualifiedClass() : string public function getFullyQualifiedName() : string
{ {
return $this->fullyQualifiedClass; return $this->fullyQualifiedClass;
} }
@ -55,7 +55,7 @@ final class AliasedObjectType extends \PHPStan\Type\ObjectType
{ {
// compare with FQN classes // compare with FQN classes
if ($type instanceof \PHPStan\Type\TypeWithClassName) { if ($type instanceof \PHPStan\Type\TypeWithClassName) {
if ($type instanceof self && $this->fullyQualifiedClass === $type->getFullyQualifiedClass()) { if ($type instanceof self && $this->fullyQualifiedClass === $type->getFullyQualifiedName()) {
return \true; return \true;
} }
if ($this->fullyQualifiedClass === $type->getClassName()) { if ($this->fullyQualifiedClass === $type->getClassName()) {

View File

@ -21,6 +21,7 @@ use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover;
use Rector\Core\Rector\AbstractRector; use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey; use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType; use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
use Rector\StaticTypeMapper\ValueObject\Type\ShortenedObjectType;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/** /**
@ -153,6 +154,11 @@ CODE_SAMPLE
if ($varTagValueNode instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode) { if ($varTagValueNode instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode) {
$this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $varTagValueNode); $this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $varTagValueNode);
} }
return new \PhpParser\Node\Expr\BooleanNot(new \PhpParser\Node\Expr\Instanceof_($expr, new \PhpParser\Node\Name\FullyQualified($type->getClassName()))); if ($type instanceof \Rector\StaticTypeMapper\ValueObject\Type\ShortenedObjectType) {
$fullyQualifiedType = $type->getFullyQualifiedName();
} else {
$fullyQualifiedType = $type->getClassName();
}
return new \PhpParser\Node\Expr\BooleanNot(new \PhpParser\Node\Expr\Instanceof_($expr, new \PhpParser\Node\Name\FullyQualified($fullyQualifiedType)));
} }
} }

View File

@ -9,7 +9,7 @@ use PhpParser\Node\Name;
final class NameAndParent final class NameAndParent
{ {
/** /**
* @var \PhpParser\Node\Name|\PhpParser\Node\Identifier * @var Name|Identifier
*/ */
private $nameNode; private $nameNode;
/** /**

View File

@ -14,11 +14,11 @@ use PhpParser\Node\Expr\Variable;
final class VariableAssignPair final class VariableAssignPair
{ {
/** /**
* @var \PhpParser\Node\Expr\Variable|\PhpParser\Node\Expr\ArrayDimFetch|\PhpParser\Node\Expr\PropertyFetch|\PhpParser\Node\Expr\StaticPropertyFetch * @var Variable|ArrayDimFetch|PropertyFetch|StaticPropertyFetch
*/ */
private $variable; private $variable;
/** /**
* @var \PhpParser\Node\Expr\Assign|\PhpParser\Node\Expr\AssignOp|\PhpParser\Node\Expr\AssignRef * @var Assign|AssignOp|AssignRef
*/ */
private $assign; private $assign;
/** /**

View File

@ -237,7 +237,7 @@ CODE_SAMPLE
return \false; return \false;
} }
if ($type instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType) { if ($type instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType) {
$typeName = $type->getFullyQualifiedClass(); $typeName = $type->getFullyQualifiedName();
} }
return !$this->reflectionProvider->hasClass($typeName); return !$this->reflectionProvider->hasClass($typeName);
} }

View File

@ -53,7 +53,7 @@ final class StrncmpMatchAndRefactor implements \Rector\Php80\Contract\StrStartWi
$this->argsAnalyzer = $argsAnalyzer; $this->argsAnalyzer = $argsAnalyzer;
} }
/** /**
* @param Identical|NotIdentical $binaryOp * @param \PhpParser\Node\Expr\BinaryOp $binaryOp
*/ */
public function match($binaryOp) : ?\Rector\Php80\ValueObject\StrStartsWith public function match($binaryOp) : ?\Rector\Php80\ValueObject\StrStartsWith
{ {

View File

@ -43,7 +43,7 @@ final class StrposMatchAndRefactor implements \Rector\Php80\Contract\StrStartWit
$this->argsAnalyzer = $argsAnalyzer; $this->argsAnalyzer = $argsAnalyzer;
} }
/** /**
* @param Identical|NotIdentical $binaryOp * @param \PhpParser\Node\Expr\BinaryOp $binaryOp
*/ */
public function match($binaryOp) : ?\Rector\Php80\ValueObject\StrStartsWith public function match($binaryOp) : ?\Rector\Php80\ValueObject\StrStartsWith
{ {

View File

@ -49,7 +49,7 @@ final class SubstrMatchAndRefactor implements \Rector\Php80\Contract\StrStartWit
$this->argsAnalyzer = $argsAnalyzer; $this->argsAnalyzer = $argsAnalyzer;
} }
/** /**
* @param Identical|NotIdentical $binaryOp * @param \PhpParser\Node\Expr\BinaryOp $binaryOp
*/ */
public function match($binaryOp) : ?\Rector\Php80\ValueObject\StrStartsWith public function match($binaryOp) : ?\Rector\Php80\ValueObject\StrStartsWith
{ {

View File

@ -21,7 +21,7 @@ final class ReturnTagReturnTypeInferer implements \Rector\TypeDeclaration\Contra
$this->phpDocInfoFactory = $phpDocInfoFactory; $this->phpDocInfoFactory = $phpDocInfoFactory;
} }
/** /**
* @param ClassMethod|Closure|Function_ $functionLike * @param \PhpParser\Node\FunctionLike $functionLike
*/ */
public function inferFunctionLike($functionLike) : \PHPStan\Type\Type public function inferFunctionLike($functionLike) : \PHPStan\Type\Type
{ {

View File

@ -75,7 +75,7 @@ final class ReturnedNodesReturnTypeInferer implements \Rector\TypeDeclaration\Co
$this->reflectionResolver = $reflectionResolver; $this->reflectionResolver = $reflectionResolver;
} }
/** /**
* @param ClassMethod|Closure|Function_ $functionLike * @param \PhpParser\Node\FunctionLike $functionLike
*/ */
public function inferFunctionLike($functionLike) : \PHPStan\Type\Type public function inferFunctionLike($functionLike) : \PHPStan\Type\Type
{ {

View File

@ -41,7 +41,7 @@ final class YieldNodesReturnTypeInferer implements \Rector\TypeDeclaration\Contr
$this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser; $this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser;
} }
/** /**
* @param ClassMethod|Function_|Closure $functionLike * @param \PhpParser\Node\FunctionLike $functionLike
*/ */
public function inferFunctionLike($functionLike) : \PHPStan\Type\Type public function inferFunctionLike($functionLike) : \PHPStan\Type\Type
{ {

View File

@ -16,11 +16,11 @@ final class VersionResolver
/** /**
* @var string * @var string
*/ */
public const PACKAGE_VERSION = '4eb4b46fa32517a38e42d654d6cb8a1566b49b83'; public const PACKAGE_VERSION = '4680c56d005b2dfade49fa14144e75862a9a8b1f';
/** /**
* @var string * @var string
*/ */
public const RELEASE_DATE = '2021-10-27 21:38:28'; public const RELEASE_DATE = '2021-10-27 23:06:12';
public static function resolvePackageVersion() : string public static function resolvePackageVersion() : string
{ {
$process = new \RectorPrefix20211027\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__); $process = new \RectorPrefix20211027\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

View File

@ -101,7 +101,7 @@ final class RectorKernel extends \RectorPrefix20211027\Symfony\Component\HttpKer
} }
/** /**
* This allows to use "%vendor%" variables in imports * This allows to use "%vendor%" variables in imports
* @param ContainerInterface|ContainerBuilder $container * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
*/ */
protected function getContainerLoader($container) : \RectorPrefix20211027\Symfony\Component\Config\Loader\DelegatingLoader protected function getContainerLoader($container) : \RectorPrefix20211027\Symfony\Component\Config\Loader\DelegatingLoader
{ {

View File

@ -24,7 +24,7 @@ final class NodeComparator
} }
/** /**
* Removes all comments from both nodes * Removes all comments from both nodes
* @param Node|Node[]|null $node * @param \PhpParser\Node|mixed[]|null $node
*/ */
public function printWithoutComments($node) : string public function printWithoutComments($node) : string
{ {
@ -33,8 +33,8 @@ final class NodeComparator
return \trim($content); return \trim($content);
} }
/** /**
* @param Node|Node[]|null $firstNode * @param \PhpParser\Node|mixed[]|null $firstNode
* @param Node|Node[]|null $secondNode * @param \PhpParser\Node|mixed[]|null $secondNode
*/ */
public function areNodesEqual($firstNode, $secondNode) : bool public function areNodesEqual($firstNode, $secondNode) : bool
{ {

View File

@ -87,7 +87,7 @@ final class BetterNodeFinder
/** /**
* @template T of Node * @template T of Node
* @param array<class-string<T>> $types * @param array<class-string<T>> $types
* @param Node|Node[]|Stmt[] $nodes * @param \PhpParser\Node|mixed[] $nodes
* @return T[] * @return T[]
*/ */
public function findInstancesOf($nodes, array $types) : array public function findInstancesOf($nodes, array $types) : array
@ -102,7 +102,7 @@ final class BetterNodeFinder
/** /**
* @template T of Node * @template T of Node
* @param class-string<T> $type * @param class-string<T> $type
* @param Node|Node[]|Stmt[] $nodes * @param \PhpParser\Node|mixed[] $nodes
* @return T[] * @return T[]
*/ */
public function findInstanceOf($nodes, string $type) : array public function findInstanceOf($nodes, string $type) : array
@ -112,7 +112,7 @@ final class BetterNodeFinder
/** /**
* @template T of Node * @template T of Node
* @param class-string<T> $type * @param class-string<T> $type
* @param Node|Node[] $nodes * @param \PhpParser\Node|mixed[] $nodes
*/ */
public function findFirstInstanceOf($nodes, string $type) : ?\PhpParser\Node public function findFirstInstanceOf($nodes, string $type) : ?\PhpParser\Node
{ {
@ -121,7 +121,7 @@ final class BetterNodeFinder
} }
/** /**
* @param class-string<Node> $type * @param class-string<Node> $type
* @param Node|Node[] $nodes * @param \PhpParser\Node|mixed[] $nodes
*/ */
public function hasInstanceOfName($nodes, string $type, string $name) : bool public function hasInstanceOfName($nodes, string $type, string $name) : bool
{ {
@ -129,14 +129,14 @@ final class BetterNodeFinder
return (bool) $this->findInstanceOfName($nodes, $type, $name); return (bool) $this->findInstanceOfName($nodes, $type, $name);
} }
/** /**
* @param Node|Node[] $nodes * @param \PhpParser\Node|mixed[] $nodes
*/ */
public function hasVariableOfName($nodes, string $name) : bool public function hasVariableOfName($nodes, string $name) : bool
{ {
return (bool) $this->findVariableOfName($nodes, $name); return (bool) $this->findVariableOfName($nodes, $name);
} }
/** /**
* @param Node|Node[] $nodes * @param \PhpParser\Node|mixed[] $nodes
* @return Variable|null * @return Variable|null
*/ */
public function findVariableOfName($nodes, string $name) : ?\PhpParser\Node public function findVariableOfName($nodes, string $name) : ?\PhpParser\Node
@ -144,7 +144,7 @@ final class BetterNodeFinder
return $this->findInstanceOfName($nodes, \PhpParser\Node\Expr\Variable::class, $name); return $this->findInstanceOfName($nodes, \PhpParser\Node\Expr\Variable::class, $name);
} }
/** /**
* @param Node|Node[] $nodes * @param \PhpParser\Node|mixed[] $nodes
* @param array<class-string<Node>> $types * @param array<class-string<Node>> $types
*/ */
public function hasInstancesOf($nodes, array $types) : bool public function hasInstancesOf($nodes, array $types) : bool
@ -162,7 +162,7 @@ final class BetterNodeFinder
/** /**
* @template T of Node * @template T of Node
* @param class-string<T> $type * @param class-string<T> $type
* @param Node|Node[] $nodes * @param \PhpParser\Node|mixed[] $nodes
*/ */
public function findLastInstanceOf($nodes, string $type) : ?\PhpParser\Node public function findLastInstanceOf($nodes, string $type) : ?\PhpParser\Node
{ {
@ -176,7 +176,7 @@ final class BetterNodeFinder
return $foundInstances[$lastItemKey]; return $foundInstances[$lastItemKey];
} }
/** /**
* @param Node|Node[] $nodes * @param \PhpParser\Node|mixed[] $nodes
* @return Node[] * @return Node[]
*/ */
public function find($nodes, callable $filter) : array public function find($nodes, callable $filter) : array
@ -186,7 +186,7 @@ final class BetterNodeFinder
/** /**
* Excludes anonymous classes! * Excludes anonymous classes!
* *
* @param Node[]|Node $nodes * @param mixed[]|\PhpParser\Node $nodes
* @return ClassLike[] * @return ClassLike[]
*/ */
public function findClassLikes($nodes) : array public function findClassLikes($nodes) : array
@ -214,7 +214,7 @@ final class BetterNodeFinder
}); });
} }
/** /**
* @param Node|Node[] $nodes * @param \PhpParser\Node|mixed[] $nodes
*/ */
public function findFirst($nodes, callable $filter) : ?\PhpParser\Node public function findFirst($nodes, callable $filter) : ?\PhpParser\Node
{ {
@ -346,7 +346,7 @@ final class BetterNodeFinder
} }
/** /**
* @template T of Node * @template T of Node
* @param Node|Node[] $nodes * @param \PhpParser\Node|mixed[] $nodes
* @param class-string<T> $type * @param class-string<T> $type
*/ */
private function findInstanceOfName($nodes, string $type, string $name) : ?\PhpParser\Node private function findInstanceOfName($nodes, string $type, string $name) : ?\PhpParser\Node

View File

@ -103,7 +103,7 @@ final class BetterStandardPrinter extends \PhpParser\PrettyPrinter\Standard
return $content; return $content;
} }
/** /**
* @param Node|Node[]|null $node * @param \PhpParser\Node|mixed[]|null $node
*/ */
public function print($node) : string public function print($node) : string
{ {

View File

@ -340,14 +340,14 @@ abstract class AbstractRector extends \PhpParser\NodeVisitorAbstract implements
return $this->nodeTypeResolver->getType($node); return $this->nodeTypeResolver->getType($node);
} }
/** /**
* @param Node|Node[] $nodes * @param \PhpParser\Node|mixed[] $nodes
*/ */
protected function traverseNodesWithCallable($nodes, callable $callable) : void protected function traverseNodesWithCallable($nodes, callable $callable) : void
{ {
$this->simpleCallableNodeTraverser->traverseNodesWithCallable($nodes, $callable); $this->simpleCallableNodeTraverser->traverseNodesWithCallable($nodes, $callable);
} }
/** /**
* @param Node|Node[]|null $node * @param \PhpParser\Node|mixed[]|null $node
*/ */
protected function print($node) : string protected function print($node) : string
{ {

View File

@ -14,7 +14,7 @@ if (!\function_exists('dn')) {
} }
if (!\function_exists('dump_node')) { if (!\function_exists('dump_node')) {
/** /**
* @param Node|Node[] $node * @param \PhpParser\Node|mixed[] $node
*/ */
function dump_node($node, int $depth = 2) : void function dump_node($node, int $depth = 2) : void
{ {
@ -26,7 +26,7 @@ if (!\function_exists('dump_node')) {
} }
if (!\function_exists('print_node')) { if (!\function_exists('print_node')) {
/** /**
* @param Node|Node[] $node * @param \PhpParser\Node|mixed[] $node
*/ */
function print_node($node) : void function print_node($node) : void
{ {

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInite52013777e5c1bbfec6ab4b14094b74b::getLoader(); return ComposerAutoloaderInit00ffe2497a59809bba63b10f37dc51f0::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInite52013777e5c1bbfec6ab4b14094b74b class ComposerAutoloaderInit00ffe2497a59809bba63b10f37dc51f0
{ {
private static $loader; private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInite52013777e5c1bbfec6ab4b14094b74b
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInite52013777e5c1bbfec6ab4b14094b74b', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit00ffe2497a59809bba63b10f37dc51f0', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInite52013777e5c1bbfec6ab4b14094b74b', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit00ffe2497a59809bba63b10f37dc51f0', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) { if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php'; require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInite52013777e5c1bbfec6ab4b14094b74b::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInit00ffe2497a59809bba63b10f37dc51f0::getInitializer($loader));
} else { } else {
$classMap = require __DIR__ . '/autoload_classmap.php'; $classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) { if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInite52013777e5c1bbfec6ab4b14094b74b
$loader->register(true); $loader->register(true);
if ($useStaticLoader) { if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInite52013777e5c1bbfec6ab4b14094b74b::$files; $includeFiles = Composer\Autoload\ComposerStaticInit00ffe2497a59809bba63b10f37dc51f0::$files;
} else { } else {
$includeFiles = require __DIR__ . '/autoload_files.php'; $includeFiles = require __DIR__ . '/autoload_files.php';
} }
foreach ($includeFiles as $fileIdentifier => $file) { foreach ($includeFiles as $fileIdentifier => $file) {
composerRequiree52013777e5c1bbfec6ab4b14094b74b($fileIdentifier, $file); composerRequire00ffe2497a59809bba63b10f37dc51f0($fileIdentifier, $file);
} }
return $loader; return $loader;
} }
} }
function composerRequiree52013777e5c1bbfec6ab4b14094b74b($fileIdentifier, $file) function composerRequire00ffe2497a59809bba63b10f37dc51f0($fileIdentifier, $file)
{ {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file; require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInite52013777e5c1bbfec6ab4b14094b74b class ComposerStaticInit00ffe2497a59809bba63b10f37dc51f0
{ {
public static $files = array ( public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3894,9 +3894,9 @@ class ComposerStaticInite52013777e5c1bbfec6ab4b14094b74b
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInite52013777e5c1bbfec6ab4b14094b74b::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInit00ffe2497a59809bba63b10f37dc51f0::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInite52013777e5c1bbfec6ab4b14094b74b::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit00ffe2497a59809bba63b10f37dc51f0::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInite52013777e5c1bbfec6ab4b14094b74b::$classMap; $loader->classMap = ComposerStaticInit00ffe2497a59809bba63b10f37dc51f0::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }

View File

@ -1418,17 +1418,17 @@
}, },
{ {
"name": "rector\/rector-phpoffice", "name": "rector\/rector-phpoffice",
"version": "0.11.4", "version": "0.11.6",
"version_normalized": "0.11.4.0", "version_normalized": "0.11.6.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-phpoffice.git", "url": "https:\/\/github.com\/rectorphp\/rector-phpoffice.git",
"reference": "ed905225deea7710855dc20154b9761a8e5a3ae7" "reference": "4a2cc96c46922633ac22ba30d5a1ad65b159cdb3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpoffice\/zipball\/ed905225deea7710855dc20154b9761a8e5a3ae7", "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpoffice\/zipball\/4a2cc96c46922633ac22ba30d5a1ad65b159cdb3",
"reference": "ed905225deea7710855dc20154b9761a8e5a3ae7", "reference": "4a2cc96c46922633ac22ba30d5a1ad65b159cdb3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1439,16 +1439,17 @@
}, },
"require-dev": { "require-dev": {
"phpstan\/extension-installer": "^1.1", "phpstan\/extension-installer": "^1.1",
"phpstan\/phpstan": "^1.0",
"phpunit\/phpunit": "^9.5", "phpunit\/phpunit": "^9.5",
"rector\/phpstan-rules": "^0.4.4", "rector\/phpstan-rules": "^0.4.7",
"rector\/rector-generator": "^0.2", "rector\/rector-generator": "^0.4",
"rector\/rector-src": "dev-main", "rector\/rector-src": "dev-main",
"symplify\/easy-coding-standard": "^9.4", "symplify\/easy-coding-standard": "^9.5",
"symplify\/phpstan-extensions": "^9.4", "symplify\/phpstan-extensions": "^9.5",
"symplify\/phpstan-rules": "^9.4", "symplify\/phpstan-rules": "^9.5",
"symplify\/rule-doc-generator": "^9.4" "symplify\/rule-doc-generator": "^9.5"
}, },
"time": "2021-10-07T19:05:12+00:00", "time": "2021-10-27T19:54:32+00:00",
"type": "rector-extension", "type": "rector-extension",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -1473,7 +1474,7 @@
"description": "Rector upgrades rules for PHP Office", "description": "Rector upgrades rules for PHP Office",
"support": { "support": {
"issues": "https:\/\/github.com\/rectorphp\/rector-phpoffice\/issues", "issues": "https:\/\/github.com\/rectorphp\/rector-phpoffice\/issues",
"source": "https:\/\/github.com\/rectorphp\/rector-phpoffice\/tree\/0.11.4" "source": "https:\/\/github.com\/rectorphp\/rector-phpoffice\/tree\/0.11.6"
}, },
"install-path": "..\/rector\/rector-phpoffice" "install-path": "..\/rector\/rector-phpoffice"
}, },
@ -3812,19 +3813,19 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https:\/\/github.com\/symplify\/astral.git", "url": "https:\/\/github.com\/symplify\/astral.git",
"reference": "aba9535e02a5e6a6df96e303665cda29ed3dfbf3" "reference": "e7743704216bd62e58eea37bcc27739210fdf71e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https:\/\/api.github.com\/repos\/symplify\/astral\/zipball\/aba9535e02a5e6a6df96e303665cda29ed3dfbf3", "url": "https:\/\/api.github.com\/repos\/symplify\/astral\/zipball\/e7743704216bd62e58eea37bcc27739210fdf71e",
"reference": "aba9535e02a5e6a6df96e303665cda29ed3dfbf3", "reference": "e7743704216bd62e58eea37bcc27739210fdf71e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"nette\/utils": "^3.2", "nette\/utils": "^3.2",
"nikic\/php-parser": "^4.13", "nikic\/php-parser": "^4.13",
"php": ">=8.0", "php": ">=8.0",
"phpstan\/phpstan": "1.0.x-dev as 0.12.99", "phpstan\/phpstan": "1.0.x-dev as 1.0",
"symfony\/dependency-injection": "^5.3|^6.0", "symfony\/dependency-injection": "^5.3|^6.0",
"symfony\/http-kernel": "^5.3|^6.0", "symfony\/http-kernel": "^5.3|^6.0",
"symplify\/package-builder": "^9.5", "symplify\/package-builder": "^9.5",
@ -3864,7 +3865,7 @@
"phpunit\/phpunit": "^9.5", "phpunit\/phpunit": "^9.5",
"symplify\/easy-testing": "^9.5" "symplify\/easy-testing": "^9.5"
}, },
"time": "2021-10-27T18:06:39+00:00", "time": "2021-10-27T23:06:13+00:00",
"default-branch": true, "default-branch": true,
"type": "phpstan-extension", "type": "phpstan-extension",
"extra": { "extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/ */
final class GeneratedConfig final class GeneratedConfig
{ {
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.6'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.26'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.8'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.31'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.4'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.14'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.31'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'v0.11.26')); public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.6'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.26'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.8'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.31'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.6'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.14'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.31'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'v0.11.26'));
private function __construct() private function __construct()
{ {
} }

View File

@ -20,7 +20,7 @@ final class VariableWithType
*/ */
private $type; private $type;
/** /**
* @var \PhpParser\Node\Identifier|\PhpParser\Node\Name|\PhpParser\Node\NullableType|\PhpParser\Node\UnionType|null * @var Identifier|Name|NullableType|UnionType|null
*/ */
private $phpParserTypeNode; private $phpParserTypeNode;
/** /**

View File

@ -25,7 +25,7 @@ final class ParamFinder
$this->nodeComparator = $nodeComparator; $this->nodeComparator = $nodeComparator;
} }
/** /**
* @param Node|Node[] $nodeHaystack * @param \PhpParser\Node|mixed[] $nodeHaystack
*/ */
public function isInAssign($nodeHaystack, \PhpParser\Node\Param $param) : bool public function isInAssign($nodeHaystack, \PhpParser\Node\Param $param) : bool
{ {

View File

@ -8,14 +8,15 @@
}, },
"require-dev": { "require-dev": {
"phpstan\/extension-installer": "^1.1", "phpstan\/extension-installer": "^1.1",
"rector\/phpstan-rules": "^0.4.4", "rector\/phpstan-rules": "^0.4.7",
"phpstan\/phpstan": "^1.0",
"phpunit\/phpunit": "^9.5", "phpunit\/phpunit": "^9.5",
"symplify\/phpstan-rules": "^9.4", "symplify\/phpstan-rules": "^9.5",
"symplify\/phpstan-extensions": "^9.4", "symplify\/phpstan-extensions": "^9.5",
"symplify\/easy-coding-standard": "^9.4", "symplify\/easy-coding-standard": "^9.5",
"symplify\/rule-doc-generator": "^9.4", "symplify\/rule-doc-generator": "^9.5",
"rector\/rector-src": "dev-main", "rector\/rector-src": "dev-main",
"rector\/rector-generator": "^0.2" "rector\/rector-generator": "^0.4"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {

View File

@ -68,7 +68,7 @@ CODE_SAMPLE
private function castArgumentToArrayIfNotArrayType(\PhpParser\Node\Expr\MethodCall $methodCall) : void private function castArgumentToArrayIfNotArrayType(\PhpParser\Node\Expr\MethodCall $methodCall) : void
{ {
$firstArgumentValue = $methodCall->args[0]->value; $firstArgumentValue = $methodCall->args[0]->value;
$firstArgumentStaticType = $this->getStaticType($firstArgumentValue); $firstArgumentStaticType = $this->getType($firstArgumentValue);
if ($firstArgumentStaticType instanceof \PHPStan\Type\ArrayType) { if ($firstArgumentStaticType instanceof \PHPStan\Type\ArrayType) {
return; return;
} }

View File

@ -11,7 +11,7 @@ use PhpParser\Node\Stmt\Expression;
final class ExpectationMock final class ExpectationMock
{ {
/** /**
* @var \PhpParser\Node\Expr\Variable|\PhpParser\Node\Expr\PropertyFetch * @var Variable|PropertyFetch
*/ */
private $expectationVariable; private $expectationVariable;
/** /**

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) { if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20211027\AutoloadIncluder'); spl_autoload_call('RectorPrefix20211027\AutoloadIncluder');
} }
if (!class_exists('ComposerAutoloaderInite52013777e5c1bbfec6ab4b14094b74b', false) && !interface_exists('ComposerAutoloaderInite52013777e5c1bbfec6ab4b14094b74b', false) && !trait_exists('ComposerAutoloaderInite52013777e5c1bbfec6ab4b14094b74b', false)) { if (!class_exists('ComposerAutoloaderInit00ffe2497a59809bba63b10f37dc51f0', false) && !interface_exists('ComposerAutoloaderInit00ffe2497a59809bba63b10f37dc51f0', false) && !trait_exists('ComposerAutoloaderInit00ffe2497a59809bba63b10f37dc51f0', false)) {
spl_autoload_call('RectorPrefix20211027\ComposerAutoloaderInite52013777e5c1bbfec6ab4b14094b74b'); spl_autoload_call('RectorPrefix20211027\ComposerAutoloaderInit00ffe2497a59809bba63b10f37dc51f0');
} }
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) { if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20211027\Helmich\TypoScriptParser\Parser\AST\Statement'); spl_autoload_call('RectorPrefix20211027\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -3306,9 +3306,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20211027\print_node(...func_get_args()); return \RectorPrefix20211027\print_node(...func_get_args());
} }
} }
if (!function_exists('composerRequiree52013777e5c1bbfec6ab4b14094b74b')) { if (!function_exists('composerRequire00ffe2497a59809bba63b10f37dc51f0')) {
function composerRequiree52013777e5c1bbfec6ab4b14094b74b() { function composerRequire00ffe2497a59809bba63b10f37dc51f0() {
return \RectorPrefix20211027\composerRequiree52013777e5c1bbfec6ab4b14094b74b(...func_get_args()); return \RectorPrefix20211027\composerRequire00ffe2497a59809bba63b10f37dc51f0(...func_get_args());
} }
} }
if (!function_exists('parseArgs')) { if (!function_exists('parseArgs')) {

View File

@ -8,7 +8,7 @@
"nette\/utils": "^3.2", "nette\/utils": "^3.2",
"symfony\/dependency-injection": "^5.3|^6.0", "symfony\/dependency-injection": "^5.3|^6.0",
"symplify\/smart-file-system": "^9.5", "symplify\/smart-file-system": "^9.5",
"phpstan\/phpstan": "1.0.x-dev as 0.12.99", "phpstan\/phpstan": "1.0.x-dev as 1.0",
"symfony\/http-kernel": "^5.3|^6.0", "symfony\/http-kernel": "^5.3|^6.0",
"nikic\/php-parser": "^4.13", "nikic\/php-parser": "^4.13",
"symplify\/package-builder": "^9.5" "symplify\/package-builder": "^9.5"

View File

@ -20,7 +20,7 @@ final class IdentifierNodeNameResolver implements \RectorPrefix20211027\Symplify
return $node instanceof \PhpParser\Node\Name; return $node instanceof \PhpParser\Node\Name;
} }
/** /**
* @param Identifier|Name $node * @param \PhpParser\Node $node
*/ */
public function resolve($node) : ?string public function resolve($node) : ?string
{ {

View File

@ -12,7 +12,7 @@ use RectorPrefix20211027\Symplify\Astral\NodeVisitor\CallableNodeVisitor;
final class SimpleCallableNodeTraverser final class SimpleCallableNodeTraverser
{ {
/** /**
* @param Node|Node[]|null $nodes * @param \PhpParser\Node|mixed[]|null $nodes
*/ */
public function traverseNodesWithCallable($nodes, callable $callable) : void public function traverseNodesWithCallable($nodes, callable $callable) : void
{ {