mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 11:50:51 +00:00
Updated Rector to commit c3e31f067de83606b46188d26fcca61a3e89c3c8
c3e31f067d
move ReturnTypeFromStrictTypedCallRector to enterprise (#2685)
This commit is contained in:
parent
4f969ebd66
commit
643657d0ed
|
@ -13,7 +13,6 @@ use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector;
|
|||
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictBoolReturnExprRector;
|
||||
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNativeCallRector;
|
||||
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNewArrayRector;
|
||||
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector;
|
||||
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector;
|
||||
use Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector;
|
||||
use Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector;
|
||||
|
@ -21,5 +20,5 @@ use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRec
|
|||
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector;
|
||||
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector;
|
||||
return static function (RectorConfig $rectorConfig) : void {
|
||||
$rectorConfig->rules([AddClosureReturnTypeRector::class, ReturnTypeFromStrictTypedPropertyRector::class, TypedPropertyFromStrictConstructorRector::class, ParamTypeFromStrictTypedPropertyRector::class, ReturnTypeFromStrictTypedCallRector::class, AddVoidReturnTypeWhereNoReturnRector::class, ReturnTypeFromReturnNewRector::class, TypedPropertyFromStrictGetterMethodReturnTypeRector::class, AddMethodCallBasedStrictParamTypeRector::class, ArrayShapeFromConstantArrayReturnRector::class, ReturnTypeFromStrictBoolReturnExprRector::class, ReturnTypeFromStrictNativeCallRector::class, ReturnTypeFromStrictNewArrayRector::class, ReturnTypeFromStrictScalarReturnExprRector::class, TypedPropertyFromStrictSetUpRector::class, ParamTypeByParentCallTypeRector::class]);
|
||||
$rectorConfig->rules([AddClosureReturnTypeRector::class, ReturnTypeFromStrictTypedPropertyRector::class, TypedPropertyFromStrictConstructorRector::class, ParamTypeFromStrictTypedPropertyRector::class, AddVoidReturnTypeWhereNoReturnRector::class, ReturnTypeFromReturnNewRector::class, TypedPropertyFromStrictGetterMethodReturnTypeRector::class, AddMethodCallBasedStrictParamTypeRector::class, ArrayShapeFromConstantArrayReturnRector::class, ReturnTypeFromStrictBoolReturnExprRector::class, ReturnTypeFromStrictNativeCallRector::class, ReturnTypeFromStrictNewArrayRector::class, ReturnTypeFromStrictScalarReturnExprRector::class, TypedPropertyFromStrictSetUpRector::class, ParamTypeByParentCallTypeRector::class]);
|
||||
};
|
||||
|
|
|
@ -1,87 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\TypeDeclaration\NodeAnalyzer;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Expr\StaticCall;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\NullableType;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
use PHPStan\Reflection\FunctionVariantWithPhpDocs;
|
||||
use PHPStan\Type\MixedType;
|
||||
use Rector\Core\Reflection\ReflectionResolver;
|
||||
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
||||
use Rector\StaticTypeMapper\StaticTypeMapper;
|
||||
final class ReturnStrictTypeAnalyzer
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Reflection\ReflectionResolver
|
||||
*/
|
||||
private $reflectionResolver;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\TypeDeclaration\NodeAnalyzer\TypeNodeUnwrapper
|
||||
*/
|
||||
private $typeNodeUnwrapper;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\StaticTypeMapper\StaticTypeMapper
|
||||
*/
|
||||
private $staticTypeMapper;
|
||||
public function __construct(ReflectionResolver $reflectionResolver, \Rector\TypeDeclaration\NodeAnalyzer\TypeNodeUnwrapper $typeNodeUnwrapper, StaticTypeMapper $staticTypeMapper)
|
||||
{
|
||||
$this->reflectionResolver = $reflectionResolver;
|
||||
$this->typeNodeUnwrapper = $typeNodeUnwrapper;
|
||||
$this->staticTypeMapper = $staticTypeMapper;
|
||||
}
|
||||
/**
|
||||
* @param Return_[] $returns
|
||||
* @return array<Identifier|Name|NullableType>
|
||||
*/
|
||||
public function collectStrictReturnTypes(array $returns) : array
|
||||
{
|
||||
$returnedStrictTypeNodes = [];
|
||||
foreach ($returns as $return) {
|
||||
if ($return->expr === null) {
|
||||
return [];
|
||||
}
|
||||
$returnedExpr = $return->expr;
|
||||
if ($returnedExpr instanceof MethodCall || $returnedExpr instanceof StaticCall || $returnedExpr instanceof FuncCall) {
|
||||
$returnNode = $this->resolveMethodCallReturnNode($returnedExpr);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
if (!$returnNode instanceof Node) {
|
||||
return [];
|
||||
}
|
||||
$returnedStrictTypeNodes[] = $returnNode;
|
||||
}
|
||||
return $this->typeNodeUnwrapper->uniquateNodes($returnedStrictTypeNodes);
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Expr\FuncCall $call
|
||||
*/
|
||||
private function resolveMethodCallReturnNode($call) : ?Node
|
||||
{
|
||||
$methodReflection = $this->reflectionResolver->resolveFunctionLikeReflectionFromCall($call);
|
||||
if ($methodReflection === null) {
|
||||
return null;
|
||||
}
|
||||
$parametersAcceptor = $methodReflection->getVariants()[0];
|
||||
if ($parametersAcceptor instanceof FunctionVariantWithPhpDocs) {
|
||||
// native return type is needed, as docblock can be false
|
||||
$returnType = $parametersAcceptor->getNativeReturnType();
|
||||
} else {
|
||||
$returnType = $parametersAcceptor->getReturnType();
|
||||
}
|
||||
if ($returnType instanceof MixedType) {
|
||||
return null;
|
||||
}
|
||||
return $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($returnType, TypeKind::RETURN);
|
||||
}
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\TypeDeclaration\NodeAnalyzer;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\NullableType;
|
||||
use PhpParser\Node\UnionType;
|
||||
use Rector\Core\PhpParser\Comparing\NodeComparator;
|
||||
final class TypeNodeUnwrapper
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\PhpParser\Comparing\NodeComparator
|
||||
*/
|
||||
private $nodeComparator;
|
||||
public function __construct(NodeComparator $nodeComparator)
|
||||
{
|
||||
$this->nodeComparator = $nodeComparator;
|
||||
}
|
||||
/**
|
||||
* @param array<UnionType|NullableType|Name|Identifier> $typeNodes
|
||||
* @return array<Name|Identifier>
|
||||
*/
|
||||
public function unwrapNullableUnionTypes(array $typeNodes) : array
|
||||
{
|
||||
$unwrappedTypeNodes = [];
|
||||
foreach ($typeNodes as $typeNode) {
|
||||
if ($typeNode instanceof UnionType) {
|
||||
$unwrappedTypeNodes = \array_merge($unwrappedTypeNodes, $typeNode->types);
|
||||
} elseif ($typeNode instanceof NullableType) {
|
||||
$unwrappedTypeNodes[] = $typeNode->type;
|
||||
$unwrappedTypeNodes[] = new Identifier('null');
|
||||
} else {
|
||||
$unwrappedTypeNodes[] = $typeNode;
|
||||
}
|
||||
}
|
||||
return $this->uniquateNodes($unwrappedTypeNodes);
|
||||
}
|
||||
/**
|
||||
* @param Node[] $nodes
|
||||
* @return Node[]
|
||||
*/
|
||||
public function uniquateNodes(array $nodes) : array
|
||||
{
|
||||
$uniqueNodes = [];
|
||||
foreach ($nodes as $node) {
|
||||
$uniqueHash = $this->nodeComparator->printWithoutComments($node);
|
||||
$uniqueNodes[$uniqueHash] = $node;
|
||||
}
|
||||
// reset keys from 0, for further compatibility
|
||||
return \array_values($uniqueNodes);
|
||||
}
|
||||
}
|
|
@ -1,225 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\TypeDeclaration\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ArrowFunction;
|
||||
use PhpParser\Node\Expr\Closure;
|
||||
use PhpParser\Node\FunctionLike;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
use PhpParser\Node\NullableType;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Function_;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
use PhpParser\Node\UnionType as PhpParserUnionType;
|
||||
use PHPStan\Type\NullType;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use PHPStan\Type\UnionType;
|
||||
use PHPStan\Type\VoidType;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
||||
use Rector\TypeDeclaration\NodeAnalyzer\ReturnStrictTypeAnalyzer;
|
||||
use Rector\TypeDeclaration\NodeAnalyzer\TypeNodeUnwrapper;
|
||||
use Rector\TypeDeclaration\TypeInferer\ReturnTypeInferer;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
* @see \Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector\ReturnTypeFromStrictTypedCallRectorTest
|
||||
*/
|
||||
final class ReturnTypeFromStrictTypedCallRector extends AbstractRector
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\TypeDeclaration\NodeAnalyzer\TypeNodeUnwrapper
|
||||
*/
|
||||
private $typeNodeUnwrapper;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\TypeDeclaration\NodeAnalyzer\ReturnStrictTypeAnalyzer
|
||||
*/
|
||||
private $returnStrictTypeAnalyzer;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\TypeDeclaration\TypeInferer\ReturnTypeInferer
|
||||
*/
|
||||
private $returnTypeInferer;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Php\PhpVersionProvider
|
||||
*/
|
||||
private $phpVersionProvider;
|
||||
public function __construct(TypeNodeUnwrapper $typeNodeUnwrapper, ReturnStrictTypeAnalyzer $returnStrictTypeAnalyzer, ReturnTypeInferer $returnTypeInferer, PhpVersionProvider $phpVersionProvider)
|
||||
{
|
||||
$this->typeNodeUnwrapper = $typeNodeUnwrapper;
|
||||
$this->returnStrictTypeAnalyzer = $returnStrictTypeAnalyzer;
|
||||
$this->returnTypeInferer = $returnTypeInferer;
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Add return type from strict return type of call', [new CodeSample(<<<'CODE_SAMPLE'
|
||||
final class SomeClass
|
||||
{
|
||||
public function getData()
|
||||
{
|
||||
return $this->getNumber();
|
||||
}
|
||||
|
||||
private function getNumber(): int
|
||||
{
|
||||
return 1000;
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
final class SomeClass
|
||||
{
|
||||
public function getData(): int
|
||||
{
|
||||
return $this->getNumber();
|
||||
}
|
||||
|
||||
private function getNumber(): int
|
||||
{
|
||||
return 1000;
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
)]);
|
||||
}
|
||||
/**
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeTypes() : array
|
||||
{
|
||||
return [ClassMethod::class, Function_::class, Closure::class, ArrowFunction::class];
|
||||
}
|
||||
/**
|
||||
* @param ClassMethod|Function_|Closure|ArrowFunction $node
|
||||
*/
|
||||
public function refactor(Node $node) : ?Node
|
||||
{
|
||||
if ($this->isSkipped($node)) {
|
||||
return null;
|
||||
}
|
||||
if ($node instanceof ArrowFunction) {
|
||||
return $this->processArrowFunction($node);
|
||||
}
|
||||
/** @var Return_[] $returns */
|
||||
$returns = $this->betterNodeFinder->find((array) $node->stmts, function (Node $subNode) use($node) : bool {
|
||||
$currentFunctionLike = $this->betterNodeFinder->findParentType($subNode, FunctionLike::class);
|
||||
if ($currentFunctionLike === $node) {
|
||||
return $subNode instanceof Return_;
|
||||
}
|
||||
$currentReturn = $this->betterNodeFinder->findParentType($subNode, Return_::class);
|
||||
if (!$currentReturn instanceof Return_) {
|
||||
return \false;
|
||||
}
|
||||
$currentFunctionLike = $this->betterNodeFinder->findParentType($currentReturn, FunctionLike::class);
|
||||
if ($currentFunctionLike !== $node) {
|
||||
return \false;
|
||||
}
|
||||
return $subNode instanceof Return_;
|
||||
});
|
||||
$returnedStrictTypes = $this->returnStrictTypeAnalyzer->collectStrictReturnTypes($returns);
|
||||
if ($returnedStrictTypes === []) {
|
||||
return null;
|
||||
}
|
||||
if (\count($returnedStrictTypes) === 1) {
|
||||
return $this->refactorSingleReturnType($returns[0], $returnedStrictTypes[0], $node);
|
||||
}
|
||||
if ($this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::UNION_TYPES)) {
|
||||
/** @var PhpParserUnionType[] $returnedStrictTypes */
|
||||
$unwrappedTypes = $this->typeNodeUnwrapper->unwrapNullableUnionTypes($returnedStrictTypes);
|
||||
$node->returnType = new PhpParserUnionType($unwrappedTypes);
|
||||
return $node;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private function processArrowFunction(ArrowFunction $arrowFunction) : ?ArrowFunction
|
||||
{
|
||||
$resolvedType = $this->nodeTypeResolver->getType($arrowFunction->expr);
|
||||
// void type is not accepted for arrow functions - https://www.php.net/manual/en/functions.arrow.php#125673
|
||||
if ($resolvedType instanceof VoidType) {
|
||||
return null;
|
||||
}
|
||||
$returnType = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($resolvedType, TypeKind::RETURN);
|
||||
if (!$returnType instanceof Node) {
|
||||
return null;
|
||||
}
|
||||
$arrowFunction->returnType = $returnType;
|
||||
return $arrowFunction;
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure $node
|
||||
*/
|
||||
private function isUnionPossibleReturnsVoid($node) : bool
|
||||
{
|
||||
$inferReturnType = $this->returnTypeInferer->inferFunctionLike($node);
|
||||
if ($inferReturnType instanceof UnionType) {
|
||||
foreach ($inferReturnType->getTypes() as $type) {
|
||||
if ($type instanceof VoidType) {
|
||||
return \true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure $node
|
||||
* @return \PhpParser\Node\Expr\Closure|\PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_
|
||||
*/
|
||||
private function processSingleUnionType($node, UnionType $unionType, NullableType $nullableType)
|
||||
{
|
||||
$types = $unionType->getTypes();
|
||||
$returnType = $types[0] instanceof ObjectType && $types[1] instanceof NullType ? new NullableType(new FullyQualified($types[0]->getClassName())) : $nullableType;
|
||||
$node->returnType = $returnType;
|
||||
return $node;
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure|\PhpParser\Node\Expr\ArrowFunction $node
|
||||
*/
|
||||
private function isSkipped($node) : bool
|
||||
{
|
||||
if (!$this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::SCALAR_TYPES)) {
|
||||
return \true;
|
||||
}
|
||||
if ($node instanceof ArrowFunction) {
|
||||
return $node->returnType !== null;
|
||||
}
|
||||
if ($node->returnType !== null) {
|
||||
return \true;
|
||||
}
|
||||
if (!$node instanceof ClassMethod) {
|
||||
return $this->isUnionPossibleReturnsVoid($node);
|
||||
}
|
||||
if (!$node->isMagic()) {
|
||||
return $this->isUnionPossibleReturnsVoid($node);
|
||||
}
|
||||
return \true;
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node\Identifier|\PhpParser\Node\Name|\PhpParser\Node\NullableType $returnedStrictTypeNode
|
||||
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure $functionLike
|
||||
* @return \PhpParser\Node\Expr\Closure|\PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_
|
||||
*/
|
||||
private function refactorSingleReturnType(Return_ $return, $returnedStrictTypeNode, $functionLike)
|
||||
{
|
||||
$resolvedType = $this->nodeTypeResolver->getType($return);
|
||||
if ($resolvedType instanceof UnionType) {
|
||||
if (!$returnedStrictTypeNode instanceof NullableType) {
|
||||
return $functionLike;
|
||||
}
|
||||
return $this->processSingleUnionType($functionLike, $resolvedType, $returnedStrictTypeNode);
|
||||
}
|
||||
/** @var Name $returnType */
|
||||
$returnType = $resolvedType instanceof ObjectType ? new FullyQualified($resolvedType->getClassName()) : $returnedStrictTypeNode;
|
||||
$functionLike->returnType = $returnType;
|
||||
return $functionLike;
|
||||
}
|
||||
}
|
|
@ -17,12 +17,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'c474c67319c9072b81dd9bcb1f4d6f201e1a1e4e';
|
||||
public const PACKAGE_VERSION = 'c3e31f067de83606b46188d26fcca61a3e89c3c8';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-07-19 18:20:44';
|
||||
public const RELEASE_DATE = '2022-07-19 20:22:36';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit4506130667ec285e11ef991df6996f82::getLoader();
|
||||
return ComposerAutoloaderInit9fa3fd1cb922a39377dcd15739c30e11::getLoader();
|
||||
|
|
3
vendor/composer/autoload_classmap.php
vendored
3
vendor/composer/autoload_classmap.php
vendored
|
@ -2992,13 +2992,11 @@ return array(
|
|||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ClassMethodParamTypeCompleter' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/ClassMethodParamTypeCompleter.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ControllerRenderMethodAnalyzer' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/ControllerRenderMethodAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnFilter\\ExclusiveNativeCallLikeReturnMatcher' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/ReturnFilter/ExclusiveNativeCallLikeReturnMatcher.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnStrictTypeAnalyzer' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/ReturnStrictTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnTypeAnalyzer\\AlwaysStrictReturnAnalyzer' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/AlwaysStrictReturnAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnTypeAnalyzer\\StrictBoolReturnTypeAnalyzer' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictBoolReturnTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnTypeAnalyzer\\StrictNativeFunctionReturnTypeAnalyzer' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictNativeFunctionReturnTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnTypeAnalyzer\\StrictReturnNewAnalyzer' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictReturnNewAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnTypeAnalyzer\\StrictScalarReturnTypeAnalyzer' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictScalarReturnTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\TypeNodeUnwrapper' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/TypeNodeUnwrapper.php',
|
||||
'Rector\\TypeDeclaration\\NodeTypeAnalyzer\\CallTypeAnalyzer' => $baseDir . '/rules/TypeDeclaration/NodeTypeAnalyzer/CallTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeTypeAnalyzer\\DetailedTypeAnalyzer' => $baseDir . '/rules/TypeDeclaration/NodeTypeAnalyzer/DetailedTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeTypeAnalyzer\\PropertyTypeDecorator' => $baseDir . '/rules/TypeDeclaration/NodeTypeAnalyzer/PropertyTypeDecorator.php',
|
||||
|
@ -3025,7 +3023,6 @@ return array(
|
|||
'Rector\\TypeDeclaration\\Rector\\ClassMethod\\ReturnTypeFromStrictBoolReturnExprRector' => $baseDir . '/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictBoolReturnExprRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\ClassMethod\\ReturnTypeFromStrictNativeCallRector' => $baseDir . '/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictNativeCallRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\ClassMethod\\ReturnTypeFromStrictNewArrayRector' => $baseDir . '/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictNewArrayRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\ClassMethod\\ReturnTypeFromStrictTypedCallRector' => $baseDir . '/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\ClassMethod\\ReturnTypeFromStrictTypedPropertyRector' => $baseDir . '/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedPropertyRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\Closure\\AddClosureReturnTypeRector' => $baseDir . '/rules/TypeDeclaration/Rector/Closure/AddClosureReturnTypeRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\FunctionLike\\ParamTypeDeclarationRector' => $baseDir . '/rules/TypeDeclaration/Rector/FunctionLike/ParamTypeDeclarationRector.php',
|
||||
|
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit4506130667ec285e11ef991df6996f82
|
||||
class ComposerAutoloaderInit9fa3fd1cb922a39377dcd15739c30e11
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,19 +22,19 @@ class ComposerAutoloaderInit4506130667ec285e11ef991df6996f82
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit4506130667ec285e11ef991df6996f82', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit9fa3fd1cb922a39377dcd15739c30e11', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit4506130667ec285e11ef991df6996f82', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit9fa3fd1cb922a39377dcd15739c30e11', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit4506130667ec285e11ef991df6996f82::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit9fa3fd1cb922a39377dcd15739c30e11::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit4506130667ec285e11ef991df6996f82::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit9fa3fd1cb922a39377dcd15739c30e11::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire4506130667ec285e11ef991df6996f82($fileIdentifier, $file);
|
||||
composerRequire9fa3fd1cb922a39377dcd15739c30e11($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
|
@ -46,7 +46,7 @@ class ComposerAutoloaderInit4506130667ec285e11ef991df6996f82
|
|||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire4506130667ec285e11ef991df6996f82($fileIdentifier, $file)
|
||||
function composerRequire9fa3fd1cb922a39377dcd15739c30e11($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
11
vendor/composer/autoload_static.php
vendored
11
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit4506130667ec285e11ef991df6996f82
|
||||
class ComposerStaticInit9fa3fd1cb922a39377dcd15739c30e11
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
|
@ -3299,13 +3299,11 @@ class ComposerStaticInit4506130667ec285e11ef991df6996f82
|
|||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ClassMethodParamTypeCompleter' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/ClassMethodParamTypeCompleter.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ControllerRenderMethodAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/ControllerRenderMethodAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnFilter\\ExclusiveNativeCallLikeReturnMatcher' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/ReturnFilter/ExclusiveNativeCallLikeReturnMatcher.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnStrictTypeAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/ReturnStrictTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnTypeAnalyzer\\AlwaysStrictReturnAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/AlwaysStrictReturnAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnTypeAnalyzer\\StrictBoolReturnTypeAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictBoolReturnTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnTypeAnalyzer\\StrictNativeFunctionReturnTypeAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictNativeFunctionReturnTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnTypeAnalyzer\\StrictReturnNewAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictReturnNewAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\ReturnTypeAnalyzer\\StrictScalarReturnTypeAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictScalarReturnTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeAnalyzer\\TypeNodeUnwrapper' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/TypeNodeUnwrapper.php',
|
||||
'Rector\\TypeDeclaration\\NodeTypeAnalyzer\\CallTypeAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeTypeAnalyzer/CallTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeTypeAnalyzer\\DetailedTypeAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeTypeAnalyzer/DetailedTypeAnalyzer.php',
|
||||
'Rector\\TypeDeclaration\\NodeTypeAnalyzer\\PropertyTypeDecorator' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeTypeAnalyzer/PropertyTypeDecorator.php',
|
||||
|
@ -3332,7 +3330,6 @@ class ComposerStaticInit4506130667ec285e11ef991df6996f82
|
|||
'Rector\\TypeDeclaration\\Rector\\ClassMethod\\ReturnTypeFromStrictBoolReturnExprRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictBoolReturnExprRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\ClassMethod\\ReturnTypeFromStrictNativeCallRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictNativeCallRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\ClassMethod\\ReturnTypeFromStrictNewArrayRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictNewArrayRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\ClassMethod\\ReturnTypeFromStrictTypedCallRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\ClassMethod\\ReturnTypeFromStrictTypedPropertyRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedPropertyRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\Closure\\AddClosureReturnTypeRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/Closure/AddClosureReturnTypeRector.php',
|
||||
'Rector\\TypeDeclaration\\Rector\\FunctionLike\\ParamTypeDeclarationRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/FunctionLike/ParamTypeDeclarationRector.php',
|
||||
|
@ -3414,9 +3411,9 @@ class ComposerStaticInit4506130667ec285e11ef991df6996f82
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit4506130667ec285e11ef991df6996f82::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit4506130667ec285e11ef991df6996f82::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit4506130667ec285e11ef991df6996f82::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit9fa3fd1cb922a39377dcd15739c30e11::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit9fa3fd1cb922a39377dcd15739c30e11::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit9fa3fd1cb922a39377dcd15739c30e11::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user