mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit fb89e317c52fb8a16e2db18edb80172adb17014e
fb89e317c5
[TypeDeclaration] Add WhileNullableToInstanceofRector (#3680)
This commit is contained in:
parent
6becad5a83
commit
a93a36635a
|
@ -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]);
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# 419 Rules Overview
|
||||
# 420 Rules Overview
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -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
|
|||
|
||||
<br>
|
||||
|
||||
### 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
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## Visibility
|
||||
|
||||
### ChangeConstantVisibilityRector
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\TypeDeclaration\Rector\While_;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\BinaryOp\NotIdentical;
|
||||
use PhpParser\Node\Expr\Instanceof_;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
use PhpParser\Node\Stmt\While_;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\TypeDeclaration\TypeAnalyzer\NullableTypeAnalyzer;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
* @see \Rector\Tests\TypeDeclaration\Rector\While_\WhileNullableToInstanceofRector\WhileNullableToInstanceofRectorTest
|
||||
*/
|
||||
final class WhileNullableToInstanceofRector 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 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<class-string<Node>>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\TypeDeclaration\TypeAnalyzer;
|
||||
|
||||
use PhpParser\Node\Expr;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use PHPStan\Type\TypeCombinator;
|
||||
use Rector\NodeTypeResolver\NodeTypeResolver;
|
||||
final class NullableTypeAnalyzer
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\NodeTypeResolver\NodeTypeResolver
|
||||
*/
|
||||
private $nodeTypeResolver;
|
||||
public function __construct(NodeTypeResolver $nodeTypeResolver)
|
||||
{
|
||||
$this->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;
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit2d334ac669fc6f05dccd2c404c3afeee::getLoader();
|
||||
return ComposerAutoloaderInitee893ce96224bcc1cead867c7c1ab3fc::getLoader();
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue