From a93a36635abb838ad19c643196a07cfb4a501fd6 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 24 Apr 2023 11:18:26 +0000 Subject: [PATCH] Updated Rector to commit fb89e317c52fb8a16e2db18edb80172adb17014e https://github.com/rectorphp/rector-src/commit/fb89e317c52fb8a16e2db18edb80172adb17014e [TypeDeclaration] Add WhileNullableToInstanceofRector (#3680) --- config/set/instanceof.php | 3 +- docs/rector_rules_overview.md | 25 ++++- ...lipTypeControlToUseExclusiveTypeRector.php | 44 ++++----- .../Rector/FuncCall/MultiDirnameRector.php | 2 +- .../BinaryOpNullableToInstanceofRector.php | 28 +++--- ...ParamAnnotationIncorrectNullableRector.php | 3 - .../VarAnnotationIncorrectNullableRector.php | 3 - .../WhileNullableToInstanceofRector.php | 97 +++++++++++++++++++ .../TypeAnalyzer/NullableTypeAnalyzer.php | 30 ++++++ src/Application/FileProcessor.php | 2 +- src/Application/VersionResolver.php | 4 +- src/PhpParser/Node/BetterNodeFinder.php | 2 +- vendor/autoload.php | 2 +- vendor/composer/autoload_classmap.php | 2 + vendor/composer/autoload_real.php | 10 +- vendor/composer/autoload_static.php | 10 +- 16 files changed, 202 insertions(+), 65 deletions(-) create mode 100644 rules/TypeDeclaration/Rector/While_/WhileNullableToInstanceofRector.php create mode 100644 rules/TypeDeclaration/TypeAnalyzer/NullableTypeAnalyzer.php diff --git a/config/set/instanceof.php b/config/set/instanceof.php index 969bf04fac0..06fdae8f238 100644 --- a/config/set/instanceof.php +++ b/config/set/instanceof.php @@ -12,6 +12,7 @@ use Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector; use Rector\TypeDeclaration\Rector\BooleanAnd\BinaryOpNullableToInstanceofRector; use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector; use Rector\TypeDeclaration\Rector\Ternary\FlipNegatedTernaryInstanceofRector; +use Rector\TypeDeclaration\Rector\While_\WhileNullableToInstanceofRector; return static function (RectorConfig $rectorConfig) : void { - $rectorConfig->rules([EmptyOnNullableObjectToInstanceOfRector::class, GetClassToInstanceOfRector::class, InlineIsAInstanceOfRector::class, FlipTypeControlToUseExclusiveTypeRector::class, RemoveDuplicatedInstanceOfRector::class, RemoveDeadInstanceOfRector::class, FlipNegatedTernaryInstanceofRector::class, BinaryOpNullableToInstanceofRector::class]); + $rectorConfig->rules([EmptyOnNullableObjectToInstanceOfRector::class, GetClassToInstanceOfRector::class, InlineIsAInstanceOfRector::class, FlipTypeControlToUseExclusiveTypeRector::class, RemoveDuplicatedInstanceOfRector::class, RemoveDeadInstanceOfRector::class, FlipNegatedTernaryInstanceofRector::class, BinaryOpNullableToInstanceofRector::class, WhileNullableToInstanceofRector::class]); }; diff --git a/docs/rector_rules_overview.md b/docs/rector_rules_overview.md index afdfede8f06..af512a1f3b7 100644 --- a/docs/rector_rules_overview.md +++ b/docs/rector_rules_overview.md @@ -1,4 +1,4 @@ -# 419 Rules Overview +# 420 Rules Overview
@@ -64,7 +64,7 @@ - [Transform](#transform) (34) -- [TypeDeclaration](#typedeclaration) (39) +- [TypeDeclaration](#typedeclaration) (40) - [Visibility](#visibility) (3) @@ -10109,6 +10109,27 @@ Add or remove null type from `@var` phpdoc typehint based on php property type d
+### WhileNullableToInstanceofRector + +Change while null compare to strict instanceof check + +- class: [`Rector\TypeDeclaration\Rector\While_\WhileNullableToInstanceofRector`](../rules/TypeDeclaration/Rector/While_/WhileNullableToInstanceofRector.php) + +```diff + final class SomeClass + { + public function run(?SomeClass $someClass) + { +- while ($someClass !== null) { ++ while ($someClass instanceof SomeClass) { + // do something + } + } + } +``` + +
+ ## Visibility ### ChangeConstantVisibilityRector diff --git a/rules/CodeQuality/Rector/Identical/FlipTypeControlToUseExclusiveTypeRector.php b/rules/CodeQuality/Rector/Identical/FlipTypeControlToUseExclusiveTypeRector.php index 55ec6bc36d0..c51f7f41abc 100644 --- a/rules/CodeQuality/Rector/Identical/FlipTypeControlToUseExclusiveTypeRector.php +++ b/rules/CodeQuality/Rector/Identical/FlipTypeControlToUseExclusiveTypeRector.php @@ -11,11 +11,9 @@ use PhpParser\Node\Expr\BooleanNot; use PhpParser\Node\Expr\Instanceof_; use PhpParser\Node\Name\FullyQualified; use PHPStan\Type\ObjectType; -use PHPStan\Type\Type; -use PHPStan\Type\TypeCombinator; -use PHPStan\Type\UnionType; use Rector\Core\Rector\AbstractRector; use Rector\StaticTypeMapper\ValueObject\Type\ShortenedObjectType; +use Rector\TypeDeclaration\TypeAnalyzer\NullableTypeAnalyzer; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** @@ -23,9 +21,18 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; */ final class FlipTypeControlToUseExclusiveTypeRector extends AbstractRector { + /** + * @readonly + * @var \Rector\TypeDeclaration\TypeAnalyzer\NullableTypeAnalyzer + */ + private $nullableTypeAnalyzer; + public function __construct(NullableTypeAnalyzer $nullableTypeAnalyzer) + { + $this->nullableTypeAnalyzer = $nullableTypeAnalyzer; + } public function getRuleDefinition() : RuleDefinition { - return new RuleDefinition('Flip type control from null compare to use exclusive instanceof type', [new CodeSample(<<<'CODE_SAMPLE' + return new RuleDefinition('Flip type control from null compare to use exclusive instanceof object', [new CodeSample(<<<'CODE_SAMPLE' function process(?DateTime $dateTime) { if ($dateTime === null) { @@ -59,36 +66,19 @@ CODE_SAMPLE if (!$expr instanceof Expr) { return null; } - $bareType = $this->matchBareNullableType($expr); - if (!$bareType instanceof Type) { + $nullableObjectType = $this->nullableTypeAnalyzer->resolveNullableObjectType($expr); + if (!$nullableObjectType instanceof ObjectType) { return null; } - return $this->processConvertToExclusiveType($bareType, $expr, $node); - } - private function matchBareNullableType(Expr $expr) : ?Type - { - $exprType = $this->getType($expr); - if (!$exprType instanceof UnionType) { - return null; - } - if (!TypeCombinator::containsNull($exprType)) { - return null; - } - if (\count($exprType->getTypes()) !== 2) { - return null; - } - return TypeCombinator::removeNull($exprType); + return $this->processConvertToExclusiveType($nullableObjectType, $expr, $node); } /** * @param \PhpParser\Node\Expr\BinaryOp\Identical|\PhpParser\Node\Expr\BinaryOp\NotIdentical $binaryOp - * @return \PhpParser\Node\Expr\BooleanNot|\PhpParser\Node\Expr\Instanceof_|null + * @return \PhpParser\Node\Expr\BooleanNot|\PhpParser\Node\Expr\Instanceof_ */ - private function processConvertToExclusiveType(Type $type, Expr $expr, $binaryOp) + private function processConvertToExclusiveType(ObjectType $objectType, Expr $expr, $binaryOp) { - if (!$type instanceof ObjectType) { - return null; - } - $fullyQualifiedType = $type instanceof ShortenedObjectType ? $type->getFullyQualifiedName() : $type->getClassName(); + $fullyQualifiedType = $objectType instanceof ShortenedObjectType ? $objectType->getFullyQualifiedName() : $objectType->getClassName(); $instanceof = new Instanceof_($expr, new FullyQualified($fullyQualifiedType)); if ($binaryOp instanceof NotIdentical) { return $instanceof; diff --git a/rules/Php70/Rector/FuncCall/MultiDirnameRector.php b/rules/Php70/Rector/FuncCall/MultiDirnameRector.php index 4041d4b5779..797a78ee1ec 100644 --- a/rules/Php70/Rector/FuncCall/MultiDirnameRector.php +++ b/rules/Php70/Rector/FuncCall/MultiDirnameRector.php @@ -47,7 +47,7 @@ final class MultiDirnameRector extends AbstractRector implements MinPhpVersionIn } $activeFuncCallNode = $node; $lastFuncCallNode = $node; - while ($activeFuncCallNode = $this->matchNestedDirnameFuncCall($activeFuncCallNode)) { + while (($activeFuncCallNode = $this->matchNestedDirnameFuncCall($activeFuncCallNode)) instanceof FuncCall) { $lastFuncCallNode = $activeFuncCallNode; } // nothing to improve diff --git a/rules/TypeDeclaration/Rector/BooleanAnd/BinaryOpNullableToInstanceofRector.php b/rules/TypeDeclaration/Rector/BooleanAnd/BinaryOpNullableToInstanceofRector.php index 101dd45dd25..65acd7b6dfd 100644 --- a/rules/TypeDeclaration/Rector/BooleanAnd/BinaryOpNullableToInstanceofRector.php +++ b/rules/TypeDeclaration/Rector/BooleanAnd/BinaryOpNullableToInstanceofRector.php @@ -11,8 +11,8 @@ use PhpParser\Node\Expr\BooleanNot; use PhpParser\Node\Expr\Instanceof_; use PhpParser\Node\Name\FullyQualified; use PHPStan\Type\ObjectType; -use PHPStan\Type\TypeCombinator; use Rector\Core\Rector\AbstractRector; +use Rector\TypeDeclaration\TypeAnalyzer\NullableTypeAnalyzer; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** @@ -20,6 +20,15 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; */ final class BinaryOpNullableToInstanceofRector extends AbstractRector { + /** + * @readonly + * @var \Rector\TypeDeclaration\TypeAnalyzer\NullableTypeAnalyzer + */ + private $nullableTypeAnalyzer; + public function __construct(NullableTypeAnalyzer $nullableTypeAnalyzer) + { + $this->nullableTypeAnalyzer = $nullableTypeAnalyzer; + } public function getRuleDefinition() : RuleDefinition { return new RuleDefinition('Change && and || between nullable objects to instanceof compares', [new CodeSample(<<<'CODE_SAMPLE' @@ -67,13 +76,13 @@ CODE_SAMPLE */ private function processsNullableInstance($node) { - $nullableObjectType = $this->returnNullableObjectType($node->left); + $nullableObjectType = $this->nullableTypeAnalyzer->resolveNullableObjectType($node->left); $hasChanged = \false; if ($nullableObjectType instanceof ObjectType) { $node->left = $this->createExprInstanceof($node->left, $nullableObjectType); $hasChanged = \true; } - $nullableObjectType = $this->returnNullableObjectType($node->right); + $nullableObjectType = $this->nullableTypeAnalyzer->resolveNullableObjectType($node->right); if ($nullableObjectType instanceof ObjectType) { $node->right = $this->createExprInstanceof($node->right, $nullableObjectType); $hasChanged = \true; @@ -87,14 +96,14 @@ CODE_SAMPLE { $hasChanged = \false; if ($booleanOr->left instanceof BooleanNot) { - $nullableObjectType = $this->returnNullableObjectType($booleanOr->left->expr); + $nullableObjectType = $this->nullableTypeAnalyzer->resolveNullableObjectType($booleanOr->left->expr); if ($nullableObjectType instanceof ObjectType) { $booleanOr->left->expr = $this->createExprInstanceof($booleanOr->left->expr, $nullableObjectType); $hasChanged = \true; } } if ($booleanOr->right instanceof BooleanNot) { - $nullableObjectType = $this->returnNullableObjectType($booleanOr->right->expr); + $nullableObjectType = $this->nullableTypeAnalyzer->resolveNullableObjectType($booleanOr->right->expr); if ($nullableObjectType instanceof ObjectType) { $booleanOr->right->expr = $this->createExprInstanceof($booleanOr->right->expr, $nullableObjectType); $hasChanged = \true; @@ -107,15 +116,6 @@ CODE_SAMPLE $result = $this->processsNullableInstance($booleanOr); return $result; } - private function returnNullableObjectType(Expr $expr) : ?\PHPStan\Type\ObjectType - { - $exprType = $this->getType($expr); - $baseType = TypeCombinator::removeNull($exprType); - if (!$baseType instanceof ObjectType) { - return null; - } - return $baseType; - } private function createExprInstanceof(Expr $expr, ObjectType $objectType) : Instanceof_ { $fullyQualified = new FullyQualified($objectType->getClassName()); diff --git a/rules/TypeDeclaration/Rector/ClassMethod/ParamAnnotationIncorrectNullableRector.php b/rules/TypeDeclaration/Rector/ClassMethod/ParamAnnotationIncorrectNullableRector.php index 82704d65ae1..bca8411c845 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/ParamAnnotationIncorrectNullableRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/ParamAnnotationIncorrectNullableRector.php @@ -154,9 +154,6 @@ CODE_SAMPLE $paramTagValueNodes = $phpDocNode->getParamTagValues(); $paramTagWasUpdated = \false; foreach ($paramTagValueNodes as $paramTagValueNode) { - if ($paramTagValueNode->type === null) { - continue; - } $param = $this->paramAnalyzer->getParamByName($paramTagValueNode->parameterName, $node); if (!$param instanceof Param) { continue; diff --git a/rules/TypeDeclaration/Rector/Property/VarAnnotationIncorrectNullableRector.php b/rules/TypeDeclaration/Rector/Property/VarAnnotationIncorrectNullableRector.php index 7dff622db57..59a11db7272 100644 --- a/rules/TypeDeclaration/Rector/Property/VarAnnotationIncorrectNullableRector.php +++ b/rules/TypeDeclaration/Rector/Property/VarAnnotationIncorrectNullableRector.php @@ -109,9 +109,6 @@ CODE_SAMPLE if (!$varTagValueNode instanceof VarTagValueNode) { return null; } - if ($varTagValueNode->type === null) { - return null; - } $docType = $this->staticTypeMapper->mapPHPStanPhpDocTypeNodeToPHPStanType($varTagValueNode->type, $node); $updatedPhpDocType = $this->phpDocNullableTypeHelper->resolveUpdatedPhpDocTypeFromPhpDocTypeAndPhpParserType($docType, $phpParserType); if (!$updatedPhpDocType instanceof Type) { diff --git a/rules/TypeDeclaration/Rector/While_/WhileNullableToInstanceofRector.php b/rules/TypeDeclaration/Rector/While_/WhileNullableToInstanceofRector.php new file mode 100644 index 00000000000..cd1ee4903f6 --- /dev/null +++ b/rules/TypeDeclaration/Rector/While_/WhileNullableToInstanceofRector.php @@ -0,0 +1,97 @@ +nullableTypeAnalyzer = $nullableTypeAnalyzer; + } + public function getRuleDefinition() : RuleDefinition + { + return new RuleDefinition('Change while null compare to strict instanceof check', [new CodeSample(<<<'CODE_SAMPLE' +final class SomeClass +{ + public function run(?SomeClass $someClass) + { + while ($someClass !== null) { + // do something + } + } +} +CODE_SAMPLE +, <<<'CODE_SAMPLE' +final class SomeClass +{ + public function run(?SomeClass $someClass) + { + while ($someClass instanceof SomeClass) { + // do something + } + } +} +CODE_SAMPLE +)]); + } + /** + * @return array> + */ + public function getNodeTypes() : array + { + return [While_::class]; + } + /** + * @param While_ $node + */ + public function refactor(Node $node) : ?Node + { + if ($node->cond instanceof NotIdentical) { + return $this->refactorNotIdentical($node, $node->cond); + } + $condNullableObjectType = $this->nullableTypeAnalyzer->resolveNullableObjectType($node->cond); + if (!$condNullableObjectType instanceof Type) { + return null; + } + $node->cond = $this->createInstanceof($node->cond, $condNullableObjectType); + return $node; + } + private function createInstanceof(Expr $expr, ObjectType $objectType) : Instanceof_ + { + $fullyQualified = new FullyQualified($objectType->getClassName()); + return new Instanceof_($expr, $fullyQualified); + } + private function refactorNotIdentical(While_ $while, NotIdentical $notIdentical) : ?\PhpParser\Node\Stmt\While_ + { + if (!$this->valueResolver->isNull($notIdentical->right)) { + return null; + } + $condNullableObjectType = $this->nullableTypeAnalyzer->resolveNullableObjectType($notIdentical->left); + if (!$condNullableObjectType instanceof ObjectType) { + return null; + } + $while->cond = $this->createInstanceof($notIdentical->left, $condNullableObjectType); + return $while; + } +} diff --git a/rules/TypeDeclaration/TypeAnalyzer/NullableTypeAnalyzer.php b/rules/TypeDeclaration/TypeAnalyzer/NullableTypeAnalyzer.php new file mode 100644 index 00000000000..68420dfb0a8 --- /dev/null +++ b/rules/TypeDeclaration/TypeAnalyzer/NullableTypeAnalyzer.php @@ -0,0 +1,30 @@ +nodeTypeResolver = $nodeTypeResolver; + } + public function resolveNullableObjectType(Expr $expr) : ?\PHPStan\Type\ObjectType + { + $exprType = $this->nodeTypeResolver->getType($expr); + $baseType = TypeCombinator::removeNull($exprType); + if (!$baseType instanceof ObjectType) { + return null; + } + return $baseType; + } +} diff --git a/src/Application/FileProcessor.php b/src/Application/FileProcessor.php index 1a33b4e0e63..63c3652a010 100644 --- a/src/Application/FileProcessor.php +++ b/src/Application/FileProcessor.php @@ -60,7 +60,7 @@ final class FileProcessor $newStmts = $this->rectorNodeTraverser->traverse($newStmts); $file->changeNewStmts($newStmts); $this->affectedFilesCollector->removeFromList($file); - while ($otherTouchedFile = $this->affectedFilesCollector->getNext()) { + while (($otherTouchedFile = $this->affectedFilesCollector->getNext()) instanceof File) { $this->refactor($otherTouchedFile, $configuration); } } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index eee57c2a0b9..e91f4201fbe 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '26bd7485f3168e92e8e4dd7c7d81d816241454bf'; + public const PACKAGE_VERSION = 'fb89e317c52fb8a16e2db18edb80172adb17014e'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-04-24 09:24:20'; + public const RELEASE_DATE = '2023-04-24 12:12:45'; /** * @var int */ diff --git a/src/PhpParser/Node/BetterNodeFinder.php b/src/PhpParser/Node/BetterNodeFinder.php index 40a8600a496..804531127e8 100644 --- a/src/PhpParser/Node/BetterNodeFinder.php +++ b/src/PhpParser/Node/BetterNodeFinder.php @@ -452,7 +452,7 @@ final class BetterNodeFinder return $node; } $currentStmt = $node; - while ($currentStmt = $currentStmt->getAttribute(AttributeKey::PARENT_NODE)) { + while (($currentStmt = $currentStmt->getAttribute(AttributeKey::PARENT_NODE)) instanceof Node) { if ($currentStmt instanceof Stmt) { return $currentStmt; } diff --git a/vendor/autoload.php b/vendor/autoload.php index 3e0c8255909..c88b3d4d748 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit2d334ac669fc6f05dccd2c404c3afeee::getLoader(); +return ComposerAutoloaderInitee893ce96224bcc1cead867c7c1ab3fc::getLoader(); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index fa6f0d42dbf..2aeaf53ba97 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2847,9 +2847,11 @@ return array( 'Rector\\TypeDeclaration\\Rector\\Property\\VarAnnotationIncorrectNullableRector' => $baseDir . '/rules/TypeDeclaration/Rector/Property/VarAnnotationIncorrectNullableRector.php', 'Rector\\TypeDeclaration\\Rector\\StmtsAwareInterface\\DeclareStrictTypesRector' => $baseDir . '/rules/TypeDeclaration/Rector/StmtsAwareInterface/DeclareStrictTypesRector.php', 'Rector\\TypeDeclaration\\Rector\\Ternary\\FlipNegatedTernaryInstanceofRector' => $baseDir . '/rules/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector.php', + 'Rector\\TypeDeclaration\\Rector\\While_\\WhileNullableToInstanceofRector' => $baseDir . '/rules/TypeDeclaration/Rector/While_/WhileNullableToInstanceofRector.php', 'Rector\\TypeDeclaration\\TypeAnalyzer\\AlwaysStrictBoolExprAnalyzer' => $baseDir . '/rules/TypeDeclaration/TypeAnalyzer/AlwaysStrictBoolExprAnalyzer.php', 'Rector\\TypeDeclaration\\TypeAnalyzer\\AlwaysStrictScalarExprAnalyzer' => $baseDir . '/rules/TypeDeclaration/TypeAnalyzer/AlwaysStrictScalarExprAnalyzer.php', 'Rector\\TypeDeclaration\\TypeAnalyzer\\GenericClassStringTypeNormalizer' => $baseDir . '/rules/TypeDeclaration/TypeAnalyzer/GenericClassStringTypeNormalizer.php', + 'Rector\\TypeDeclaration\\TypeAnalyzer\\NullableTypeAnalyzer' => $baseDir . '/rules/TypeDeclaration/TypeAnalyzer/NullableTypeAnalyzer.php', 'Rector\\TypeDeclaration\\TypeAnalyzer\\ReturnStrictTypeAnalyzer' => $baseDir . '/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php', 'Rector\\TypeDeclaration\\TypeAnalyzer\\StrictReturnClassConstReturnTypeAnalyzer' => $baseDir . '/rules/TypeDeclaration/TypeAnalyzer/StrictReturnClassConstReturnTypeAnalyzer.php', 'Rector\\TypeDeclaration\\TypeInferer\\AssignToPropertyTypeInferer' => $baseDir . '/rules/TypeDeclaration/TypeInferer/AssignToPropertyTypeInferer.php', diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 51dad1b9a47..a3ed1979d17 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit2d334ac669fc6f05dccd2c404c3afeee +class ComposerAutoloaderInitee893ce96224bcc1cead867c7c1ab3fc { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInit2d334ac669fc6f05dccd2c404c3afeee return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit2d334ac669fc6f05dccd2c404c3afeee', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitee893ce96224bcc1cead867c7c1ab3fc', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit2d334ac669fc6f05dccd2c404c3afeee', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitee893ce96224bcc1cead867c7c1ab3fc', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit2d334ac669fc6f05dccd2c404c3afeee::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitee893ce96224bcc1cead867c7c1ab3fc::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit2d334ac669fc6f05dccd2c404c3afeee::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInitee893ce96224bcc1cead867c7c1ab3fc::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 38d46b5166c..b6a6944288d 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit2d334ac669fc6f05dccd2c404c3afeee +class ComposerStaticInitee893ce96224bcc1cead867c7c1ab3fc { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3094,9 +3094,11 @@ class ComposerStaticInit2d334ac669fc6f05dccd2c404c3afeee 'Rector\\TypeDeclaration\\Rector\\Property\\VarAnnotationIncorrectNullableRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/Property/VarAnnotationIncorrectNullableRector.php', 'Rector\\TypeDeclaration\\Rector\\StmtsAwareInterface\\DeclareStrictTypesRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/StmtsAwareInterface/DeclareStrictTypesRector.php', 'Rector\\TypeDeclaration\\Rector\\Ternary\\FlipNegatedTernaryInstanceofRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector.php', + 'Rector\\TypeDeclaration\\Rector\\While_\\WhileNullableToInstanceofRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/While_/WhileNullableToInstanceofRector.php', 'Rector\\TypeDeclaration\\TypeAnalyzer\\AlwaysStrictBoolExprAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/TypeAnalyzer/AlwaysStrictBoolExprAnalyzer.php', 'Rector\\TypeDeclaration\\TypeAnalyzer\\AlwaysStrictScalarExprAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/TypeAnalyzer/AlwaysStrictScalarExprAnalyzer.php', 'Rector\\TypeDeclaration\\TypeAnalyzer\\GenericClassStringTypeNormalizer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/TypeAnalyzer/GenericClassStringTypeNormalizer.php', + 'Rector\\TypeDeclaration\\TypeAnalyzer\\NullableTypeAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/TypeAnalyzer/NullableTypeAnalyzer.php', 'Rector\\TypeDeclaration\\TypeAnalyzer\\ReturnStrictTypeAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php', 'Rector\\TypeDeclaration\\TypeAnalyzer\\StrictReturnClassConstReturnTypeAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/TypeAnalyzer/StrictReturnClassConstReturnTypeAnalyzer.php', 'Rector\\TypeDeclaration\\TypeInferer\\AssignToPropertyTypeInferer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/TypeInferer/AssignToPropertyTypeInferer.php', @@ -3148,9 +3150,9 @@ class ComposerStaticInit2d334ac669fc6f05dccd2c404c3afeee public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit2d334ac669fc6f05dccd2c404c3afeee::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit2d334ac669fc6f05dccd2c404c3afeee::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit2d334ac669fc6f05dccd2c404c3afeee::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitee893ce96224bcc1cead867c7c1ab3fc::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitee893ce96224bcc1cead867c7c1ab3fc::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitee893ce96224bcc1cead867c7c1ab3fc::$classMap; }, null, ClassLoader::class); }