mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 21:38:22 +01:00
Updated Rector to commit efd09bbb400b2382be39effc206551e6964fa5ea
efd09bbb40
Compatibility with BetterReflection 6.x on ClassFromEnumFactory (#3150)
This commit is contained in:
parent
642698e22d
commit
83accd4a98
@ -83,9 +83,8 @@ final class ClassRenamePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor
|
||||
if ($virtualNode === \true) {
|
||||
return null;
|
||||
}
|
||||
$identifier = clone $node;
|
||||
$identifier->name = $this->resolveNamespacedName($identifier, $phpParserNode, $node->name);
|
||||
$staticType = $this->staticTypeMapper->mapPHPStanPhpDocTypeNodeToPHPStanType($identifier, $phpParserNode);
|
||||
$node->name = $this->resolveNamespacedName($node, $phpParserNode, $node->name);
|
||||
$staticType = $this->staticTypeMapper->mapPHPStanPhpDocTypeNodeToPHPStanType($node, $phpParserNode);
|
||||
// make sure to compare FQNs
|
||||
$objectType = $this->expandShortenedObjectType($staticType);
|
||||
foreach ($this->oldToNewTypes as $oldToNewType) {
|
||||
@ -130,18 +129,21 @@ final class ClassRenamePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor
|
||||
return $this->resolveNamefromUse($uses, $name);
|
||||
}
|
||||
$originalNode = $namespace->getAttribute(AttributeKey::ORIGINAL_NODE);
|
||||
if (!$originalNode instanceof Namespace_) {
|
||||
return $name;
|
||||
}
|
||||
$namespaceName = (string) $this->nodeNameResolver->getName($namespace);
|
||||
if ($originalNode instanceof Namespace_ && !$this->nodeNameResolver->isName($originalNode, $namespaceName)) {
|
||||
if (!$this->nodeNameResolver->isName($originalNode, $namespaceName)) {
|
||||
return $name;
|
||||
}
|
||||
if ($uses === []) {
|
||||
return $namespaceName . '\\' . $name;
|
||||
return '\\' . \ltrim($namespaceName . '\\' . $name, '\\');
|
||||
}
|
||||
$nameFromUse = $this->resolveNamefromUse($uses, $name);
|
||||
if ($nameFromUse !== $name) {
|
||||
return $nameFromUse;
|
||||
}
|
||||
return $namespaceName . '\\' . $nameFromUse;
|
||||
return '\\' . \ltrim($namespaceName . '\\' . $nameFromUse, '\\');
|
||||
}
|
||||
/**
|
||||
* @param Use_[]|GroupUse[] $uses
|
||||
|
@ -97,6 +97,11 @@ final class WorkerRunner
|
||||
}
|
||||
$currentErrorsAndFileDiffs = $this->phpFileProcessor->process($file, $configuration);
|
||||
$errorAndFileDiffs = $this->arrayParametersMerger->merge($errorAndFileDiffs, $currentErrorsAndFileDiffs);
|
||||
// warn about deprecated @noRector annotation
|
||||
if (\substr_compare($file->getFilePath(), 'WorkerRunner.php', -\strlen('WorkerRunner.php')) !== 0 && (\strpos($file->getFileContent(), ' @noRector ') !== \false || \strpos($file->getFileContent(), ' @norector ') !== \false)) {
|
||||
$systemErrors[] = new SystemError('The @noRector annotation was deprecated and removed due to hiding fixed errors. Use more precise $rectorConfig->skip() method in the rector.php config.', $file->getFilePath());
|
||||
continue;
|
||||
}
|
||||
} catch (Throwable $throwable) {
|
||||
++$systemErrorsCount;
|
||||
$systemErrors = $this->collectSystemErrors($systemErrors, $throwable, $filePath);
|
||||
|
@ -7,10 +7,9 @@ use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
/**
|
||||
* @noRector final on purpose, so it can be extended by 3rd party
|
||||
* @api
|
||||
*/
|
||||
class SimplePhpDocNode extends PhpDocNode
|
||||
final class SimplePhpDocNode extends PhpDocNode
|
||||
{
|
||||
public function getParam(string $desiredParamName) : ?ParamTagValueNode
|
||||
{
|
||||
|
@ -9,6 +9,7 @@ use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node\Expr\ArrowFunction;
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
use PhpParser\Node\Expr\Closure;
|
||||
use PhpParser\Node\Expr\ClosureUse;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\Name;
|
||||
@ -36,22 +37,28 @@ final class ArrayFilterFactory
|
||||
$arrayFilterFuncCall = new FuncCall(new Name('array_filter'), $args);
|
||||
return new Assign($arrayDimFetch->var, $arrayFilterFuncCall);
|
||||
}
|
||||
public function createWithClosure(ArrayDimFetch $arrayDimFetch, Variable $valueVariable, Expr $condExpr, Foreach_ $foreach) : Assign
|
||||
/**
|
||||
* @param Variable[] $uses
|
||||
*/
|
||||
public function createWithClosure(ArrayDimFetch $arrayDimFetch, Variable $valueVariable, Expr $condExpr, Foreach_ $foreach, array $uses) : Assign
|
||||
{
|
||||
$filterFunction = $this->createClosure($valueVariable, $condExpr);
|
||||
$filterFunction = $this->createClosure($valueVariable, $condExpr, $uses);
|
||||
$args = [new Arg($foreach->expr), new Arg($filterFunction)];
|
||||
$arrayFilterFuncCall = new FuncCall(new Name('array_filter'), $args);
|
||||
return new Assign($arrayDimFetch->var, $arrayFilterFuncCall);
|
||||
}
|
||||
/**
|
||||
* @param Variable[] $uses
|
||||
* @return \PhpParser\Node\Expr\ArrowFunction|\PhpParser\Node\Expr\Closure
|
||||
*/
|
||||
private function createClosure(Variable $valueVariable, Expr $condExpr)
|
||||
private function createClosure(Variable $valueVariable, Expr $condExpr, array $uses)
|
||||
{
|
||||
$params = [new Param($valueVariable)];
|
||||
if ($this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::ARROW_FUNCTION)) {
|
||||
return new ArrowFunction(['params' => $params, 'expr' => $condExpr]);
|
||||
}
|
||||
return new Closure(['params' => $params, 'stmts' => [new Return_($condExpr)]]);
|
||||
return new Closure(['params' => $params, 'stmts' => [new Return_($condExpr)], 'uses' => \array_map(static function (Variable $variable) : ClosureUse {
|
||||
return new ClosureUse($variable);
|
||||
}, $uses)]);
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,9 @@ use PHPStan\Type\ArrayType;
|
||||
use PHPStan\Type\MixedType;
|
||||
use PHPStan\Type\UnionType;
|
||||
use Rector\CodeQuality\NodeFactory\ArrayFilterFactory;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\DeadCode\NodeAnalyzer\ExprUsedInNodeAnalyzer;
|
||||
use Rector\ReadWrite\NodeAnalyzer\ReadExprAnalyzer;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
@ -41,11 +43,17 @@ final class SimplifyForeachToArrayFilterRector extends AbstractRector
|
||||
* @var \Rector\ReadWrite\NodeAnalyzer\ReadExprAnalyzer
|
||||
*/
|
||||
private $readExprAnalyzer;
|
||||
public function __construct(ArrayFilterFactory $arrayFilterFactory, ExprUsedInNodeAnalyzer $exprUsedInNodeAnalyzer, ReadExprAnalyzer $readExprAnalyzer)
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Php\PhpVersionProvider
|
||||
*/
|
||||
private $phpVersionProvider;
|
||||
public function __construct(ArrayFilterFactory $arrayFilterFactory, ExprUsedInNodeAnalyzer $exprUsedInNodeAnalyzer, ReadExprAnalyzer $readExprAnalyzer, PhpVersionProvider $phpVersionProvider)
|
||||
{
|
||||
$this->arrayFilterFactory = $arrayFilterFactory;
|
||||
$this->exprUsedInNodeAnalyzer = $exprUsedInNodeAnalyzer;
|
||||
$this->readExprAnalyzer = $readExprAnalyzer;
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
@ -211,12 +219,32 @@ CODE_SAMPLE
|
||||
return null;
|
||||
}
|
||||
// the keyvar must be variable in array dim fetch
|
||||
if (!$foreach->keyVar instanceof Expr) {
|
||||
$keyVar = $foreach->keyVar;
|
||||
if (!$keyVar instanceof Variable) {
|
||||
return null;
|
||||
}
|
||||
if (!$this->nodeComparator->areNodesEqual($arrayDimFetch->dim, $foreach->keyVar)) {
|
||||
return null;
|
||||
}
|
||||
return $this->arrayFilterFactory->createWithClosure($assign->var, $variable, $condExpr, $foreach);
|
||||
return $this->arrayFilterFactory->createWithClosure($assign->var, $variable, $condExpr, $foreach, $this->getUsedVariablesForClosure($keyVar, $variable, $condExpr));
|
||||
}
|
||||
/**
|
||||
* @return Variable[]
|
||||
*/
|
||||
private function getUsedVariablesForClosure(Variable $keyVar, Variable $valueVar, Expr $condExpr) : array
|
||||
{
|
||||
if ($this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::ARROW_FUNCTION)) {
|
||||
return [];
|
||||
}
|
||||
/** @var Variable[] $filteredVariables */
|
||||
$filteredVariables = $this->betterNodeFinder->find($condExpr, function (Node $node) use($keyVar, $valueVar) : bool {
|
||||
return $node instanceof Variable && !$this->nodeComparator->areNodesEqual($keyVar, $node) && !$this->nodeComparator->areNodesEqual($valueVar, $node) && !$this->nodeNameResolver->isName($node, 'this');
|
||||
});
|
||||
$uniqueVariables = [];
|
||||
foreach ($filteredVariables as $filteredVariable) {
|
||||
$variableName = $this->nodeNameResolver->getName($filteredVariable);
|
||||
$uniqueVariables[$variableName] = $filteredVariable;
|
||||
}
|
||||
return \array_values($uniqueVariables);
|
||||
}
|
||||
}
|
||||
|
@ -85,28 +85,27 @@ CODE_SAMPLE
|
||||
*/
|
||||
public function refactor(Node $node)
|
||||
{
|
||||
$processNode = clone $node;
|
||||
if ($this->inlineHTMLAnalyzer->hasInlineHTML($processNode)) {
|
||||
if ($this->inlineHTMLAnalyzer->hasInlineHTML($node)) {
|
||||
return null;
|
||||
}
|
||||
$expectedNamespace = $this->psr4AutoloadNamespaceMatcher->getExpectedNamespace($this->file, $processNode);
|
||||
$expectedNamespace = $this->psr4AutoloadNamespaceMatcher->getExpectedNamespace($this->file, $node);
|
||||
if ($expectedNamespace === null) {
|
||||
return null;
|
||||
}
|
||||
// is namespace and already correctly named?
|
||||
if ($processNode instanceof Namespace_ && $this->nodeNameResolver->isCaseSensitiveName($processNode, $expectedNamespace)) {
|
||||
if ($node instanceof Namespace_ && $this->nodeNameResolver->isCaseSensitiveName($node, $expectedNamespace)) {
|
||||
return null;
|
||||
}
|
||||
if ($processNode instanceof Namespace_ && $this->hasNamespaceInPreviousNamespace($processNode)) {
|
||||
if ($node instanceof Namespace_ && $this->hasNamespaceInPreviousNamespace($node)) {
|
||||
return null;
|
||||
}
|
||||
// to put declare_strict types on correct place
|
||||
if ($processNode instanceof FileWithoutNamespace) {
|
||||
return $this->refactorFileWithoutNamespace($processNode, $expectedNamespace);
|
||||
if ($node instanceof FileWithoutNamespace) {
|
||||
return $this->refactorFileWithoutNamespace($node, $expectedNamespace);
|
||||
}
|
||||
$processNode->name = new Name($expectedNamespace);
|
||||
$this->fullyQualifyStmtsAnalyzer->process($processNode->stmts);
|
||||
return $processNode;
|
||||
$node->name = new Name($expectedNamespace);
|
||||
$this->fullyQualifyStmtsAnalyzer->process($node->stmts);
|
||||
return $node;
|
||||
}
|
||||
private function hasNamespaceInPreviousNamespace(Namespace_ $namespace) : bool
|
||||
{
|
||||
|
@ -33,9 +33,9 @@ final class ClassFromEnumFactory
|
||||
continue;
|
||||
}
|
||||
$constValue = $this->createConstValue($stmt);
|
||||
$classStmts[] = new ClassConst([new Const_($stmt->name, $constValue)], Visibility::PUBLIC);
|
||||
$classStmts[] = new ClassConst([new Const_($stmt->name, $constValue)], Visibility::PUBLIC, ['startLine' => $stmt->getStartLine(), 'endLine' => $stmt->getEndLine()]);
|
||||
}
|
||||
$class = new Class_($shortClassName, ['stmts' => $classStmts]);
|
||||
$class = new Class_($shortClassName, ['stmts' => $classStmts], ['startLine' => $enum->getStartLine(), 'endLine' => $enum->getEndLine()]);
|
||||
$class->namespacedName = $enum->namespacedName;
|
||||
return $class;
|
||||
}
|
||||
|
@ -17,12 +17,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'e8a252fe262cac38eb74b9584f78e2daee006ffa';
|
||||
public const PACKAGE_VERSION = 'efd09bbb400b2382be39effc206551e6964fa5ea';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-12-03 12:29:17';
|
||||
public const RELEASE_DATE = '2022-12-04 13:10:11';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -1,22 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202212\Symplify\AutowireArrayParameter\DependencyInjection\CompilerPass;
|
||||
namespace Rector\Core\DependencyInjection\CompilerPass;
|
||||
|
||||
use RectorPrefix202212\Nette\Utils\Strings;
|
||||
use Rector\Core\DependencyInjection\DefinitionFinder;
|
||||
use Rector\Core\DependencyInjection\DocBlock\ParamTypeDocBlockResolver;
|
||||
use Rector\Core\DependencyInjection\Skipper\ParameterSkipper;
|
||||
use Rector\Core\DependencyInjection\TypeResolver\ParameterTypeResolver;
|
||||
use ReflectionClass;
|
||||
use ReflectionMethod;
|
||||
use RectorPrefix202212\Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use RectorPrefix202212\Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use RectorPrefix202212\Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use RectorPrefix202212\Symfony\Component\DependencyInjection\Definition;
|
||||
use RectorPrefix202212\Symfony\Component\DependencyInjection\Reference;
|
||||
use RectorPrefix202212\Symplify\AutowireArrayParameter\DependencyInjection\DefinitionFinder;
|
||||
use RectorPrefix202212\Symplify\AutowireArrayParameter\DocBlock\ParamTypeDocBlockResolver;
|
||||
use RectorPrefix202212\Symplify\AutowireArrayParameter\Skipper\ParameterSkipper;
|
||||
use RectorPrefix202212\Symplify\AutowireArrayParameter\TypeResolver\ParameterTypeResolver;
|
||||
/**
|
||||
* @inspiration https://github.com/nette/di/pull/178
|
||||
* @see \Symplify\AutowireArrayParameter\Tests\DependencyInjection\CompilerPass\AutowireArrayParameterCompilerPassTest
|
||||
*/
|
||||
final class AutowireArrayParameterCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
@ -29,21 +29,22 @@ final class AutowireArrayParameterCompilerPass implements CompilerPassInterface
|
||||
/**
|
||||
* Classes that create circular dependencies
|
||||
*
|
||||
* @var string[]
|
||||
* @noRector \Rector\Privatization\Rector\Property\ChangeReadOnlyPropertyWithDefaultValueToConstantRector
|
||||
* @noRector \Rector\Php55\Rector\String_\StringClassNameToClassConstantRector
|
||||
* @var class-string<LoaderInterface>[]|string[]
|
||||
*/
|
||||
private $excludedFatalClasses = ['RectorPrefix202212\\Symfony\\Component\\Form\\FormExtensionInterface', 'RectorPrefix202212\\Symfony\\Component\\Asset\\PackageInterface', 'RectorPrefix202212\\Symfony\\Component\\Config\\Loader\\LoaderInterface', 'RectorPrefix202212\\Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\ContextProviderInterface', 'RectorPrefix202212\\EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Configurator\\TypeConfiguratorInterface', 'RectorPrefix202212\\Sonata\\CoreBundle\\Model\\Adapter\\AdapterInterface', 'RectorPrefix202212\\Sonata\\Doctrine\\Adapter\\AdapterChain', 'RectorPrefix202212\\Sonata\\Twig\\Extension\\TemplateExtension', 'RectorPrefix202212\\Symfony\\Component\\HttpKernel\\KernelInterface'];
|
||||
private const EXCLUDED_FATAL_CLASSES = ['Symfony\\Component\\Form\\FormExtensionInterface', 'Symfony\\Component\\Asset\\PackageInterface', 'Symfony\\Component\\Config\\Loader\\LoaderInterface', 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\ContextProviderInterface', 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Configurator\\TypeConfiguratorInterface', 'Sonata\\CoreBundle\\Model\\Adapter\\AdapterInterface', 'Sonata\\Doctrine\\Adapter\\AdapterChain', 'Sonata\\Twig\\Extension\\TemplateExtension', 'Symfony\\Component\\HttpKernel\\KernelInterface'];
|
||||
/**
|
||||
* @var \Symplify\AutowireArrayParameter\DependencyInjection\DefinitionFinder
|
||||
* @readonly
|
||||
* @var \Rector\Core\DependencyInjection\DefinitionFinder
|
||||
*/
|
||||
private $definitionFinder;
|
||||
/**
|
||||
* @var \Symplify\AutowireArrayParameter\TypeResolver\ParameterTypeResolver
|
||||
* @readonly
|
||||
* @var \Rector\Core\DependencyInjection\TypeResolver\ParameterTypeResolver
|
||||
*/
|
||||
private $parameterTypeResolver;
|
||||
/**
|
||||
* @var \Symplify\AutowireArrayParameter\Skipper\ParameterSkipper
|
||||
* @readonly
|
||||
* @var \Rector\Core\DependencyInjection\Skipper\ParameterSkipper
|
||||
*/
|
||||
private $parameterSkipper;
|
||||
/**
|
||||
@ -86,7 +87,7 @@ final class AutowireArrayParameterCompilerPass implements CompilerPassInterface
|
||||
if (Strings::match($resolvedClassName, $excludedNamespacePattern)) {
|
||||
return \true;
|
||||
}
|
||||
if (\in_array($resolvedClassName, $this->excludedFatalClasses, \true)) {
|
||||
if (\in_array($resolvedClassName, self::EXCLUDED_FATAL_CLASSES, \true)) {
|
||||
return \true;
|
||||
}
|
||||
if ($definition->getFactory()) {
|
@ -1,15 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202212\Symplify\AutowireArrayParameter\DependencyInjection;
|
||||
namespace Rector\Core\DependencyInjection;
|
||||
|
||||
use Rector\Core\DependencyInjection\Exception\DefinitionForTypeNotFoundException;
|
||||
use RectorPrefix202212\Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use RectorPrefix202212\Symfony\Component\DependencyInjection\Definition;
|
||||
use RectorPrefix202212\Symplify\AutowireArrayParameter\Exception\DependencyInjection\DefinitionForTypeNotFoundException;
|
||||
use Throwable;
|
||||
/**
|
||||
* @api
|
||||
* @see \Symplify\AutowireArrayParameter\Tests\DependencyInjection\DefinitionFinderTest
|
||||
*/
|
||||
final class DefinitionFinder
|
||||
{
|
@ -1,12 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202212\Symplify\AutowireArrayParameter\DocBlock;
|
||||
namespace Rector\Core\DependencyInjection\DocBlock;
|
||||
|
||||
use RectorPrefix202212\Nette\Utils\Strings;
|
||||
/**
|
||||
* @see \Symplify\AutowireArrayParameter\Tests\DocBlock\ParamTypeDocBlockResolverTest
|
||||
*/
|
||||
final class ParamTypeDocBlockResolver
|
||||
{
|
||||
/**
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202212\Symplify\AutowireArrayParameter\Exception\DependencyInjection;
|
||||
namespace Rector\Core\DependencyInjection\Exception;
|
||||
|
||||
use Exception;
|
||||
final class DefinitionForTypeNotFoundException extends Exception
|
@ -1,33 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202212\Symplify\AutowireArrayParameter\Skipper;
|
||||
namespace Rector\Core\DependencyInjection\Skipper;
|
||||
|
||||
use Rector\Core\DependencyInjection\TypeResolver\ParameterTypeResolver;
|
||||
use ReflectionMethod;
|
||||
use ReflectionNamedType;
|
||||
use ReflectionParameter;
|
||||
use RectorPrefix202212\Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use RectorPrefix202212\Symfony\Component\DependencyInjection\Definition;
|
||||
use RectorPrefix202212\Symplify\AutowireArrayParameter\TypeResolver\ParameterTypeResolver;
|
||||
final class ParameterSkipper
|
||||
{
|
||||
/**
|
||||
* Classes that create circular dependencies
|
||||
*
|
||||
* @var string[]
|
||||
* @var class-string<LoaderInterface>[]|string[]
|
||||
*/
|
||||
private const DEFAULT_EXCLUDED_FATAL_CLASSES = ['RectorPrefix202212\\Symfony\\Component\\Form\\FormExtensionInterface', 'RectorPrefix202212\\Symfony\\Component\\Asset\\PackageInterface', 'RectorPrefix202212\\Symfony\\Component\\Config\\Loader\\LoaderInterface', 'RectorPrefix202212\\Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\ContextProviderInterface', 'RectorPrefix202212\\EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Configurator\\TypeConfiguratorInterface', 'RectorPrefix202212\\Sonata\\CoreBundle\\Model\\Adapter\\AdapterInterface', 'RectorPrefix202212\\Sonata\\Doctrine\\Adapter\\AdapterChain', 'RectorPrefix202212\\Sonata\\Twig\\Extension\\TemplateExtension'];
|
||||
private const DEFAULT_EXCLUDED_FATAL_CLASSES = ['Symfony\\Component\\Form\\FormExtensionInterface', 'Symfony\\Component\\Asset\\PackageInterface', 'Symfony\\Component\\Config\\Loader\\LoaderInterface', 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\ContextProviderInterface', 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Configurator\\TypeConfiguratorInterface', 'Sonata\\CoreBundle\\Model\\Adapter\\AdapterInterface', 'Sonata\\Doctrine\\Adapter\\AdapterChain', 'Sonata\\Twig\\Extension\\TemplateExtension'];
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $excludedFatalClasses = [];
|
||||
/**
|
||||
* @var \Symplify\AutowireArrayParameter\TypeResolver\ParameterTypeResolver
|
||||
* @readonly
|
||||
* @var \Rector\Core\DependencyInjection\TypeResolver\ParameterTypeResolver
|
||||
*/
|
||||
private $parameterTypeResolver;
|
||||
/**
|
||||
* @param string[] $excludedFatalClasses
|
||||
*/
|
||||
public function __construct(ParameterTypeResolver $parameterTypeResolver, array $excludedFatalClasses)
|
||||
public function __construct(ParameterTypeResolver $parameterTypeResolver, array $excludedFatalClasses = [])
|
||||
{
|
||||
$this->parameterTypeResolver = $parameterTypeResolver;
|
||||
$this->excludedFatalClasses = \array_merge(self::DEFAULT_EXCLUDED_FATAL_CLASSES, $excludedFatalClasses);
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202212\Symplify\AutowireArrayParameter\TypeResolver;
|
||||
namespace Rector\Core\DependencyInjection\TypeResolver;
|
||||
|
||||
use RectorPrefix202212\Nette\Utils\Reflection;
|
||||
use Rector\Core\DependencyInjection\DocBlock\ParamTypeDocBlockResolver;
|
||||
use ReflectionMethod;
|
||||
use RectorPrefix202212\Symplify\AutowireArrayParameter\DocBlock\ParamTypeDocBlockResolver;
|
||||
final class ParameterTypeResolver
|
||||
{
|
||||
/**
|
||||
@ -13,7 +13,8 @@ final class ParameterTypeResolver
|
||||
*/
|
||||
private $resolvedParameterTypesCached = [];
|
||||
/**
|
||||
* @var \Symplify\AutowireArrayParameter\DocBlock\ParamTypeDocBlockResolver
|
||||
* @readonly
|
||||
* @var \Rector\Core\DependencyInjection\DocBlock\ParamTypeDocBlockResolver
|
||||
*/
|
||||
private $paramTypeDocBlockResolver;
|
||||
public function __construct(ParamTypeDocBlockResolver $paramTypeDocBlockResolver)
|
@ -1,114 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Core\Exclusion;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Const_;
|
||||
use PhpParser\Node\Stmt;
|
||||
use PhpParser\Node\Stmt\PropertyProperty;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode;
|
||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
|
||||
use Rector\Core\Contract\Rector\PhpRectorInterface;
|
||||
use Rector\Core\Contract\Rector\RectorInterface;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use Rector\Core\Util\StringUtils;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Exclusion\ExclusionManagerTest
|
||||
*/
|
||||
final class ExclusionManager
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
* @see https://regex101.com/r/DKW6RE/1
|
||||
*/
|
||||
private const NO_RECTOR_START_REGEX = '#@noRector$#';
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory
|
||||
*/
|
||||
private $phpDocInfoFactory;
|
||||
public function __construct(PhpDocInfoFactory $phpDocInfoFactory)
|
||||
{
|
||||
$this->phpDocInfoFactory = $phpDocInfoFactory;
|
||||
}
|
||||
/**
|
||||
* @param class-string<PhpRectorInterface> $rectorClass
|
||||
*/
|
||||
public function isNodeSkippedByRector(Node $node, string $rectorClass) : bool
|
||||
{
|
||||
if ($node instanceof PropertyProperty || $node instanceof Const_) {
|
||||
$node = $node->getAttribute(AttributeKey::PARENT_NODE);
|
||||
if (!$node instanceof Node) {
|
||||
return \false;
|
||||
}
|
||||
}
|
||||
if ($this->hasNoRectorPhpDocTagMatch($node, $rectorClass)) {
|
||||
return \true;
|
||||
}
|
||||
if ($node instanceof Stmt) {
|
||||
return \false;
|
||||
}
|
||||
// recurse up until a Stmt node is found since it might contain a noRector
|
||||
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
|
||||
if (!$parentNode instanceof Node) {
|
||||
return \false;
|
||||
}
|
||||
return $this->isNodeSkippedByRector($parentNode, $rectorClass);
|
||||
}
|
||||
/**
|
||||
* @param class-string<PhpRectorInterface> $rectorClass
|
||||
*/
|
||||
private function hasNoRectorPhpDocTagMatch(Node $node, string $rectorClass) : bool
|
||||
{
|
||||
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node);
|
||||
/** @var PhpDocTagNode[] $noRectorTags */
|
||||
$noRectorTags = \array_merge($phpDocInfo->getTagsByName('noRector'), $phpDocInfo->getTagsByName('norector'));
|
||||
if ($this->matchesNoRectorTag($noRectorTags, $rectorClass)) {
|
||||
return \true;
|
||||
}
|
||||
return $this->matchesNoRectorComment($node, $rectorClass);
|
||||
}
|
||||
/**
|
||||
* @param PhpDocTagNode[] $noRectorPhpDocTagNodes
|
||||
* @param class-string<RectorInterface> $rectorClass
|
||||
*/
|
||||
private function matchesNoRectorTag(array $noRectorPhpDocTagNodes, string $rectorClass) : bool
|
||||
{
|
||||
foreach ($noRectorPhpDocTagNodes as $noRectorPhpDocTagNode) {
|
||||
if (!$noRectorPhpDocTagNode->value instanceof GenericTagValueNode) {
|
||||
throw new ShouldNotHappenException();
|
||||
}
|
||||
$description = $noRectorPhpDocTagNode->value->value;
|
||||
if ($description === '') {
|
||||
return \true;
|
||||
}
|
||||
$description = \ltrim($description, '\\');
|
||||
if ($description === $rectorClass) {
|
||||
return \true;
|
||||
}
|
||||
if (!\is_a($description, RectorInterface::class, \true)) {
|
||||
return \true;
|
||||
}
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
/**
|
||||
* @param class-string<RectorInterface> $rectorClass
|
||||
*/
|
||||
private function matchesNoRectorComment(Node $node, string $rectorClass) : bool
|
||||
{
|
||||
foreach ($node->getComments() as $comment) {
|
||||
if (StringUtils::isMatch($comment->getText(), self::NO_RECTOR_START_REGEX)) {
|
||||
return \true;
|
||||
}
|
||||
$noRectorWithRule = '#@noRector \\\\?' . \preg_quote($rectorClass, '#') . '$#';
|
||||
if (StringUtils::isMatch($comment->getText(), $noRectorWithRule)) {
|
||||
return \true;
|
||||
}
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ namespace Rector\Core\Kernel;
|
||||
|
||||
use Rector\Core\Config\Loader\ConfigureCallMergingLoaderFactory;
|
||||
use Rector\Core\DependencyInjection\Collector\ConfigureCallValuesCollector;
|
||||
use Rector\Core\DependencyInjection\CompilerPass\AutowireArrayParameterCompilerPass;
|
||||
use Rector\Core\DependencyInjection\CompilerPass\AutowireRectorCompilerPass;
|
||||
use Rector\Core\DependencyInjection\CompilerPass\MakeRectorsPublicCompilerPass;
|
||||
use Rector\Core\DependencyInjection\CompilerPass\MergeImportedRectorConfigureCallValuesCompilerPass;
|
||||
@ -13,7 +14,6 @@ use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use RectorPrefix202212\Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use RectorPrefix202212\Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use RectorPrefix202212\Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use RectorPrefix202212\Symplify\AutowireArrayParameter\DependencyInjection\CompilerPass\AutowireArrayParameterCompilerPass;
|
||||
final class RectorKernel
|
||||
{
|
||||
/**
|
||||
|
@ -24,7 +24,6 @@ use Rector\Core\Configuration\CurrentNodeProvider;
|
||||
use Rector\Core\Console\Output\RectorOutputStyle;
|
||||
use Rector\Core\Contract\Rector\PhpRectorInterface;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use Rector\Core\Exclusion\ExclusionManager;
|
||||
use Rector\Core\FileSystem\FilePathHelper;
|
||||
use Rector\Core\Logging\CurrentRectorProvider;
|
||||
use Rector\Core\NodeDecorator\CreatedByRuleDecorator;
|
||||
@ -114,10 +113,6 @@ CODE_SAMPLE;
|
||||
* @var \Rector\PhpDocParser\NodeTraverser\SimpleCallableNodeTraverser
|
||||
*/
|
||||
private $simpleCallableNodeTraverser;
|
||||
/**
|
||||
* @var \Rector\Core\Exclusion\ExclusionManager
|
||||
*/
|
||||
private $exclusionManager;
|
||||
/**
|
||||
* @var \Rector\Core\Logging\CurrentRectorProvider
|
||||
*/
|
||||
@ -161,7 +156,7 @@ CODE_SAMPLE;
|
||||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowire(NodesToRemoveCollector $nodesToRemoveCollector, NodeRemover $nodeRemover, NodeNameResolver $nodeNameResolver, NodeTypeResolver $nodeTypeResolver, SimpleCallableNodeTraverser $simpleCallableNodeTraverser, NodeFactory $nodeFactory, PhpDocInfoFactory $phpDocInfoFactory, ExclusionManager $exclusionManager, StaticTypeMapper $staticTypeMapper, CurrentRectorProvider $currentRectorProvider, CurrentNodeProvider $currentNodeProvider, Skipper $skipper, ValueResolver $valueResolver, BetterNodeFinder $betterNodeFinder, NodeComparator $nodeComparator, CurrentFileProvider $currentFileProvider, RectifiedAnalyzer $rectifiedAnalyzer, CreatedByRuleDecorator $createdByRuleDecorator, ChangedNodeScopeRefresher $changedNodeScopeRefresher, RectorOutputStyle $rectorOutputStyle, FilePathHelper $filePathHelper, DocBlockUpdater $docBlockUpdater) : void
|
||||
public function autowire(NodesToRemoveCollector $nodesToRemoveCollector, NodeRemover $nodeRemover, NodeNameResolver $nodeNameResolver, NodeTypeResolver $nodeTypeResolver, SimpleCallableNodeTraverser $simpleCallableNodeTraverser, NodeFactory $nodeFactory, PhpDocInfoFactory $phpDocInfoFactory, StaticTypeMapper $staticTypeMapper, CurrentRectorProvider $currentRectorProvider, CurrentNodeProvider $currentNodeProvider, Skipper $skipper, ValueResolver $valueResolver, BetterNodeFinder $betterNodeFinder, NodeComparator $nodeComparator, CurrentFileProvider $currentFileProvider, RectifiedAnalyzer $rectifiedAnalyzer, CreatedByRuleDecorator $createdByRuleDecorator, ChangedNodeScopeRefresher $changedNodeScopeRefresher, RectorOutputStyle $rectorOutputStyle, FilePathHelper $filePathHelper, DocBlockUpdater $docBlockUpdater) : void
|
||||
{
|
||||
$this->nodesToRemoveCollector = $nodesToRemoveCollector;
|
||||
$this->nodeRemover = $nodeRemover;
|
||||
@ -170,7 +165,6 @@ CODE_SAMPLE;
|
||||
$this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser;
|
||||
$this->nodeFactory = $nodeFactory;
|
||||
$this->phpDocInfoFactory = $phpDocInfoFactory;
|
||||
$this->exclusionManager = $exclusionManager;
|
||||
$this->staticTypeMapper = $staticTypeMapper;
|
||||
$this->currentRectorProvider = $currentRectorProvider;
|
||||
$this->currentNodeProvider = $currentNodeProvider;
|
||||
@ -363,9 +357,6 @@ CODE_SAMPLE;
|
||||
if ($this->nodesToRemoveCollector->isNodeRemoved($node)) {
|
||||
return \true;
|
||||
}
|
||||
if ($this->exclusionManager->isNodeSkippedByRector($node, static::class)) {
|
||||
return \true;
|
||||
}
|
||||
$filePath = $this->file->getFilePath();
|
||||
if ($this->skipper->shouldSkipElementAndFilePath($this, $filePath)) {
|
||||
return \true;
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitef9a533724006031add2916a3c9c8c2e::getLoader();
|
||||
return ComposerAutoloaderInita4f22922e85306bbfc938da51fec6447::getLoader();
|
||||
|
13
vendor/composer/autoload_classmap.php
vendored
13
vendor/composer/autoload_classmap.php
vendored
@ -1033,12 +1033,6 @@ return array(
|
||||
'RectorPrefix202212\\Symfony\\Contracts\\Translation\\TranslatableInterface' => $vendorDir . '/symfony/contracts/Translation/TranslatableInterface.php',
|
||||
'RectorPrefix202212\\Symfony\\Contracts\\Translation\\TranslatorInterface' => $vendorDir . '/symfony/contracts/Translation/TranslatorInterface.php',
|
||||
'RectorPrefix202212\\Symfony\\Contracts\\Translation\\TranslatorTrait' => $vendorDir . '/symfony/contracts/Translation/TranslatorTrait.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\DependencyInjection\\CompilerPass\\AutowireArrayParameterCompilerPass' => $vendorDir . '/symplify/autowire-array-parameter/src/DependencyInjection/CompilerPass/AutowireArrayParameterCompilerPass.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\DependencyInjection\\DefinitionFinder' => $vendorDir . '/symplify/autowire-array-parameter/src/DependencyInjection/DefinitionFinder.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\DocBlock\\ParamTypeDocBlockResolver' => $vendorDir . '/symplify/autowire-array-parameter/src/DocBlock/ParamTypeDocBlockResolver.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\Exception\\DependencyInjection\\DefinitionForTypeNotFoundException' => $vendorDir . '/symplify/autowire-array-parameter/src/Exception/DependencyInjection/DefinitionForTypeNotFoundException.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\Skipper\\ParameterSkipper' => $vendorDir . '/symplify/autowire-array-parameter/src/Skipper/ParameterSkipper.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\TypeResolver\\ParameterTypeResolver' => $vendorDir . '/symplify/autowire-array-parameter/src/TypeResolver/ParameterTypeResolver.php',
|
||||
'RectorPrefix202212\\Symplify\\EasyParallel\\CommandLine\\WorkerCommandLineFactory' => $vendorDir . '/symplify/easy-parallel/src/CommandLine/WorkerCommandLineFactory.php',
|
||||
'RectorPrefix202212\\Symplify\\EasyParallel\\Contract\\SerializableInterface' => $vendorDir . '/symplify/easy-parallel/src/Contract/SerializableInterface.php',
|
||||
'RectorPrefix202212\\Symplify\\EasyParallel\\CpuCoreCountProvider' => $vendorDir . '/symplify/easy-parallel/src/CpuCoreCountProvider.php',
|
||||
@ -1358,13 +1352,19 @@ return array(
|
||||
'Rector\\Core\\Contract\\Rector\\ScopeAwarePhpRectorInterface' => $baseDir . '/src/Contract/Rector/ScopeAwarePhpRectorInterface.php',
|
||||
'Rector\\Core\\Contract\\Template\\TemplateResolverInterface' => $baseDir . '/src/Contract/Template/TemplateResolverInterface.php',
|
||||
'Rector\\Core\\DependencyInjection\\Collector\\ConfigureCallValuesCollector' => $baseDir . '/src/DependencyInjection/Collector/ConfigureCallValuesCollector.php',
|
||||
'Rector\\Core\\DependencyInjection\\CompilerPass\\AutowireArrayParameterCompilerPass' => $baseDir . '/src/DependencyInjection/CompilerPass/AutowireArrayParameterCompilerPass.php',
|
||||
'Rector\\Core\\DependencyInjection\\CompilerPass\\AutowireRectorCompilerPass' => $baseDir . '/src/DependencyInjection/CompilerPass/AutowireRectorCompilerPass.php',
|
||||
'Rector\\Core\\DependencyInjection\\CompilerPass\\MakeRectorsPublicCompilerPass' => $baseDir . '/src/DependencyInjection/CompilerPass/MakeRectorsPublicCompilerPass.php',
|
||||
'Rector\\Core\\DependencyInjection\\CompilerPass\\MergeImportedRectorConfigureCallValuesCompilerPass' => $baseDir . '/src/DependencyInjection/CompilerPass/MergeImportedRectorConfigureCallValuesCompilerPass.php',
|
||||
'Rector\\Core\\DependencyInjection\\CompilerPass\\RemoveSkippedRectorsCompilerPass' => $baseDir . '/src/DependencyInjection/CompilerPass/RemoveSkippedRectorsCompilerPass.php',
|
||||
'Rector\\Core\\DependencyInjection\\DefinitionFinder' => $baseDir . '/src/DependencyInjection/DefinitionFinder.php',
|
||||
'Rector\\Core\\DependencyInjection\\DocBlock\\ParamTypeDocBlockResolver' => $baseDir . '/src/DependencyInjection/DocBlock/ParamTypeDocBlockResolver.php',
|
||||
'Rector\\Core\\DependencyInjection\\Exception\\DefinitionForTypeNotFoundException' => $baseDir . '/src/DependencyInjection/Exception/DefinitionForTypeNotFoundException.php',
|
||||
'Rector\\Core\\DependencyInjection\\Loader\\ConfigurableCallValuesCollectingPhpFileLoader' => $baseDir . '/src/DependencyInjection/Loader/ConfigurableCallValuesCollectingPhpFileLoader.php',
|
||||
'Rector\\Core\\DependencyInjection\\Loader\\Configurator\\RectorServiceConfigurator' => $baseDir . '/src/DependencyInjection/Loader/Configurator/RectorServiceConfigurator.php',
|
||||
'Rector\\Core\\DependencyInjection\\RectorContainerFactory' => $baseDir . '/src/DependencyInjection/RectorContainerFactory.php',
|
||||
'Rector\\Core\\DependencyInjection\\Skipper\\ParameterSkipper' => $baseDir . '/src/DependencyInjection/Skipper/ParameterSkipper.php',
|
||||
'Rector\\Core\\DependencyInjection\\TypeResolver\\ParameterTypeResolver' => $baseDir . '/src/DependencyInjection/TypeResolver/ParameterTypeResolver.php',
|
||||
'Rector\\Core\\Differ\\DefaultDiffer' => $baseDir . '/src/Differ/DefaultDiffer.php',
|
||||
'Rector\\Core\\Enum\\ObjectReference' => $baseDir . '/src/Enum/ObjectReference.php',
|
||||
'Rector\\Core\\Error\\ExceptionCorrector' => $baseDir . '/src/Error/ExceptionCorrector.php',
|
||||
@ -1376,7 +1376,6 @@ return array(
|
||||
'Rector\\Core\\Exception\\Reflection\\MissingPrivatePropertyException' => $baseDir . '/src/Exception/Reflection/MissingPrivatePropertyException.php',
|
||||
'Rector\\Core\\Exception\\ShouldNotHappenException' => $baseDir . '/src/Exception/ShouldNotHappenException.php',
|
||||
'Rector\\Core\\Exception\\VersionException' => $baseDir . '/src/Exception/VersionException.php',
|
||||
'Rector\\Core\\Exclusion\\ExclusionManager' => $baseDir . '/src/Exclusion/ExclusionManager.php',
|
||||
'Rector\\Core\\FileSystem\\FileAndDirectoryFilter' => $baseDir . '/src/FileSystem/FileAndDirectoryFilter.php',
|
||||
'Rector\\Core\\FileSystem\\FilePathHelper' => $baseDir . '/src/FileSystem/FilePathHelper.php',
|
||||
'Rector\\Core\\FileSystem\\FilesFinder' => $baseDir . '/src/FileSystem/FilesFinder.php',
|
||||
|
1
vendor/composer/autoload_psr4.php
vendored
1
vendor/composer/autoload_psr4.php
vendored
@ -19,7 +19,6 @@ return array(
|
||||
'Rector\\' => array($baseDir . '/packages', $baseDir . '/rules', $vendorDir . '/rector/rector-downgrade-php/src', $vendorDir . '/rector/rector-downgrade-php/rules'),
|
||||
'RectorPrefix202212\\Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'),
|
||||
'RectorPrefix202212\\Symplify\\EasyParallel\\' => array($vendorDir . '/symplify/easy-parallel/src'),
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\' => array($vendorDir . '/symplify/autowire-array-parameter/src'),
|
||||
'RectorPrefix202212\\Symfony\\Contracts\\' => array($vendorDir . '/symfony/contracts'),
|
||||
'RectorPrefix202212\\Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'),
|
||||
'RectorPrefix202212\\Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
|
||||
|
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 ComposerAutoloaderInitef9a533724006031add2916a3c9c8c2e
|
||||
class ComposerAutoloaderInita4f22922e85306bbfc938da51fec6447
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInitef9a533724006031add2916a3c9c8c2e
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitef9a533724006031add2916a3c9c8c2e', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInita4f22922e85306bbfc938da51fec6447', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitef9a533724006031add2916a3c9c8c2e', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInita4f22922e85306bbfc938da51fec6447', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitef9a533724006031add2916a3c9c8c2e::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInita4f22922e85306bbfc938da51fec6447::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitef9a533724006031add2916a3c9c8c2e::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInita4f22922e85306bbfc938da51fec6447::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequireef9a533724006031add2916a3c9c8c2e($fileIdentifier, $file);
|
||||
composerRequirea4f22922e85306bbfc938da51fec6447($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInitef9a533724006031add2916a3c9c8c2e
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequireef9a533724006031add2916a3c9c8c2e($fileIdentifier, $file)
|
||||
function composerRequirea4f22922e85306bbfc938da51fec6447($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
26
vendor/composer/autoload_static.php
vendored
26
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitef9a533724006031add2916a3c9c8c2e
|
||||
class ComposerStaticInita4f22922e85306bbfc938da51fec6447
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -36,7 +36,6 @@ class ComposerStaticInitef9a533724006031add2916a3c9c8c2e
|
||||
'Rector\\' => 7,
|
||||
'RectorPrefix202212\\Webmozart\\Assert\\' => 36,
|
||||
'RectorPrefix202212\\Symplify\\EasyParallel\\' => 41,
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\' => 51,
|
||||
'RectorPrefix202212\\Symfony\\Contracts\\' => 37,
|
||||
'RectorPrefix202212\\Symfony\\Component\\String\\' => 44,
|
||||
'RectorPrefix202212\\Symfony\\Component\\Finder\\' => 44,
|
||||
@ -128,10 +127,6 @@ class ComposerStaticInitef9a533724006031add2916a3c9c8c2e
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symplify/easy-parallel/src',
|
||||
),
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symplify/autowire-array-parameter/src',
|
||||
),
|
||||
'RectorPrefix202212\\Symfony\\Contracts\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/contracts',
|
||||
@ -1278,12 +1273,6 @@ class ComposerStaticInitef9a533724006031add2916a3c9c8c2e
|
||||
'RectorPrefix202212\\Symfony\\Contracts\\Translation\\TranslatableInterface' => __DIR__ . '/..' . '/symfony/contracts/Translation/TranslatableInterface.php',
|
||||
'RectorPrefix202212\\Symfony\\Contracts\\Translation\\TranslatorInterface' => __DIR__ . '/..' . '/symfony/contracts/Translation/TranslatorInterface.php',
|
||||
'RectorPrefix202212\\Symfony\\Contracts\\Translation\\TranslatorTrait' => __DIR__ . '/..' . '/symfony/contracts/Translation/TranslatorTrait.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\DependencyInjection\\CompilerPass\\AutowireArrayParameterCompilerPass' => __DIR__ . '/..' . '/symplify/autowire-array-parameter/src/DependencyInjection/CompilerPass/AutowireArrayParameterCompilerPass.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\DependencyInjection\\DefinitionFinder' => __DIR__ . '/..' . '/symplify/autowire-array-parameter/src/DependencyInjection/DefinitionFinder.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\DocBlock\\ParamTypeDocBlockResolver' => __DIR__ . '/..' . '/symplify/autowire-array-parameter/src/DocBlock/ParamTypeDocBlockResolver.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\Exception\\DependencyInjection\\DefinitionForTypeNotFoundException' => __DIR__ . '/..' . '/symplify/autowire-array-parameter/src/Exception/DependencyInjection/DefinitionForTypeNotFoundException.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\Skipper\\ParameterSkipper' => __DIR__ . '/..' . '/symplify/autowire-array-parameter/src/Skipper/ParameterSkipper.php',
|
||||
'RectorPrefix202212\\Symplify\\AutowireArrayParameter\\TypeResolver\\ParameterTypeResolver' => __DIR__ . '/..' . '/symplify/autowire-array-parameter/src/TypeResolver/ParameterTypeResolver.php',
|
||||
'RectorPrefix202212\\Symplify\\EasyParallel\\CommandLine\\WorkerCommandLineFactory' => __DIR__ . '/..' . '/symplify/easy-parallel/src/CommandLine/WorkerCommandLineFactory.php',
|
||||
'RectorPrefix202212\\Symplify\\EasyParallel\\Contract\\SerializableInterface' => __DIR__ . '/..' . '/symplify/easy-parallel/src/Contract/SerializableInterface.php',
|
||||
'RectorPrefix202212\\Symplify\\EasyParallel\\CpuCoreCountProvider' => __DIR__ . '/..' . '/symplify/easy-parallel/src/CpuCoreCountProvider.php',
|
||||
@ -1603,13 +1592,19 @@ class ComposerStaticInitef9a533724006031add2916a3c9c8c2e
|
||||
'Rector\\Core\\Contract\\Rector\\ScopeAwarePhpRectorInterface' => __DIR__ . '/../..' . '/src/Contract/Rector/ScopeAwarePhpRectorInterface.php',
|
||||
'Rector\\Core\\Contract\\Template\\TemplateResolverInterface' => __DIR__ . '/../..' . '/src/Contract/Template/TemplateResolverInterface.php',
|
||||
'Rector\\Core\\DependencyInjection\\Collector\\ConfigureCallValuesCollector' => __DIR__ . '/../..' . '/src/DependencyInjection/Collector/ConfigureCallValuesCollector.php',
|
||||
'Rector\\Core\\DependencyInjection\\CompilerPass\\AutowireArrayParameterCompilerPass' => __DIR__ . '/../..' . '/src/DependencyInjection/CompilerPass/AutowireArrayParameterCompilerPass.php',
|
||||
'Rector\\Core\\DependencyInjection\\CompilerPass\\AutowireRectorCompilerPass' => __DIR__ . '/../..' . '/src/DependencyInjection/CompilerPass/AutowireRectorCompilerPass.php',
|
||||
'Rector\\Core\\DependencyInjection\\CompilerPass\\MakeRectorsPublicCompilerPass' => __DIR__ . '/../..' . '/src/DependencyInjection/CompilerPass/MakeRectorsPublicCompilerPass.php',
|
||||
'Rector\\Core\\DependencyInjection\\CompilerPass\\MergeImportedRectorConfigureCallValuesCompilerPass' => __DIR__ . '/../..' . '/src/DependencyInjection/CompilerPass/MergeImportedRectorConfigureCallValuesCompilerPass.php',
|
||||
'Rector\\Core\\DependencyInjection\\CompilerPass\\RemoveSkippedRectorsCompilerPass' => __DIR__ . '/../..' . '/src/DependencyInjection/CompilerPass/RemoveSkippedRectorsCompilerPass.php',
|
||||
'Rector\\Core\\DependencyInjection\\DefinitionFinder' => __DIR__ . '/../..' . '/src/DependencyInjection/DefinitionFinder.php',
|
||||
'Rector\\Core\\DependencyInjection\\DocBlock\\ParamTypeDocBlockResolver' => __DIR__ . '/../..' . '/src/DependencyInjection/DocBlock/ParamTypeDocBlockResolver.php',
|
||||
'Rector\\Core\\DependencyInjection\\Exception\\DefinitionForTypeNotFoundException' => __DIR__ . '/../..' . '/src/DependencyInjection/Exception/DefinitionForTypeNotFoundException.php',
|
||||
'Rector\\Core\\DependencyInjection\\Loader\\ConfigurableCallValuesCollectingPhpFileLoader' => __DIR__ . '/../..' . '/src/DependencyInjection/Loader/ConfigurableCallValuesCollectingPhpFileLoader.php',
|
||||
'Rector\\Core\\DependencyInjection\\Loader\\Configurator\\RectorServiceConfigurator' => __DIR__ . '/../..' . '/src/DependencyInjection/Loader/Configurator/RectorServiceConfigurator.php',
|
||||
'Rector\\Core\\DependencyInjection\\RectorContainerFactory' => __DIR__ . '/../..' . '/src/DependencyInjection/RectorContainerFactory.php',
|
||||
'Rector\\Core\\DependencyInjection\\Skipper\\ParameterSkipper' => __DIR__ . '/../..' . '/src/DependencyInjection/Skipper/ParameterSkipper.php',
|
||||
'Rector\\Core\\DependencyInjection\\TypeResolver\\ParameterTypeResolver' => __DIR__ . '/../..' . '/src/DependencyInjection/TypeResolver/ParameterTypeResolver.php',
|
||||
'Rector\\Core\\Differ\\DefaultDiffer' => __DIR__ . '/../..' . '/src/Differ/DefaultDiffer.php',
|
||||
'Rector\\Core\\Enum\\ObjectReference' => __DIR__ . '/../..' . '/src/Enum/ObjectReference.php',
|
||||
'Rector\\Core\\Error\\ExceptionCorrector' => __DIR__ . '/../..' . '/src/Error/ExceptionCorrector.php',
|
||||
@ -1621,7 +1616,6 @@ class ComposerStaticInitef9a533724006031add2916a3c9c8c2e
|
||||
'Rector\\Core\\Exception\\Reflection\\MissingPrivatePropertyException' => __DIR__ . '/../..' . '/src/Exception/Reflection/MissingPrivatePropertyException.php',
|
||||
'Rector\\Core\\Exception\\ShouldNotHappenException' => __DIR__ . '/../..' . '/src/Exception/ShouldNotHappenException.php',
|
||||
'Rector\\Core\\Exception\\VersionException' => __DIR__ . '/../..' . '/src/Exception/VersionException.php',
|
||||
'Rector\\Core\\Exclusion\\ExclusionManager' => __DIR__ . '/../..' . '/src/Exclusion/ExclusionManager.php',
|
||||
'Rector\\Core\\FileSystem\\FileAndDirectoryFilter' => __DIR__ . '/../..' . '/src/FileSystem/FileAndDirectoryFilter.php',
|
||||
'Rector\\Core\\FileSystem\\FilePathHelper' => __DIR__ . '/../..' . '/src/FileSystem/FilePathHelper.php',
|
||||
'Rector\\Core\\FileSystem\\FilesFinder' => __DIR__ . '/../..' . '/src/FileSystem/FilesFinder.php',
|
||||
@ -3023,9 +3017,9 @@ class ComposerStaticInitef9a533724006031add2916a3c9c8c2e
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitef9a533724006031add2916a3c9c8c2e::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitef9a533724006031add2916a3c9c8c2e::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitef9a533724006031add2916a3c9c8c2e::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita4f22922e85306bbfc938da51fec6447::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita4f22922e85306bbfc938da51fec6447::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInita4f22922e85306bbfc938da51fec6447::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
78
vendor/composer/installed.json
vendored
78
vendor/composer/installed.json
vendored
@ -2967,84 +2967,6 @@
|
||||
],
|
||||
"install-path": "..\/symfony\/string"
|
||||
},
|
||||
{
|
||||
"name": "symplify\/autowire-array-parameter",
|
||||
"version": "11.1.17",
|
||||
"version_normalized": "11.1.17.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/autowire-array-parameter.git",
|
||||
"reference": "55242ce6403e25590bbffa581471f097c4a7109d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/autowire-array-parameter\/zipball\/55242ce6403e25590bbffa581471f097c4a7109d",
|
||||
"reference": "55242ce6403e25590bbffa581471f097c4a7109d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"nette\/utils": "^3.2",
|
||||
"php": ">=8.1",
|
||||
"symfony\/dependency-injection": "^6.1"
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/coding-standard": "<11.1.17",
|
||||
"symplify\/composer-json-manipulator": "<11.1.17",
|
||||
"symplify\/config-transformer": "<11.1.17",
|
||||
"symplify\/easy-ci": "<11.1.17",
|
||||
"symplify\/easy-coding-standard": "<11.1.17",
|
||||
"symplify\/easy-parallel": "<11.1.17",
|
||||
"symplify\/easy-testing": "<11.1.17",
|
||||
"symplify\/monorepo-builder": "<11.1.17",
|
||||
"symplify\/package-builder": "<11.1.17",
|
||||
"symplify\/php-config-printer": "<11.1.17",
|
||||
"symplify\/phpstan-extensions": "<11.1.17",
|
||||
"symplify\/phpstan-rules": "<11.1.17",
|
||||
"symplify\/rule-doc-generator": "<11.1.17",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.17",
|
||||
"symplify\/smart-file-system": "<11.1.17",
|
||||
"symplify\/symfony-static-dumper": "<11.1.17",
|
||||
"symplify\/symplify-kernel": "<11.1.17",
|
||||
"symplify\/vendor-patches": "<11.1.17"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5.25",
|
||||
"symplify\/package-builder": "^11.1.17",
|
||||
"symplify\/symplify-kernel": "^11.1.17"
|
||||
},
|
||||
"time": "2022-11-10T15:22:46+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "11.2-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202212\\Symplify\\AutowireArrayParameter\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https:\/\/packagist.org\/downloads\/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Autowire array parameters for your Symfony applications",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/autowire-array-parameter\/tree\/11.1.17"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https:\/\/www.paypal.me\/rectorphp",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https:\/\/github.com\/tomasvotruba",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"install-path": "..\/symplify\/autowire-array-parameter"
|
||||
},
|
||||
{
|
||||
"name": "symplify\/easy-parallel",
|
||||
"version": "11.1.17",
|
||||
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
25
vendor/symplify/autowire-array-parameter/LICENSE
vendored
25
vendor/symplify/autowire-array-parameter/LICENSE
vendored
@ -1,25 +0,0 @@
|
||||
The MIT License
|
||||
---------------
|
||||
|
||||
Copyright (c) 2018 Tomas Votruba (https://tomasvotruba.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
@ -1,52 +0,0 @@
|
||||
{
|
||||
"name": "symplify\/autowire-array-parameter",
|
||||
"description": "Autowire array parameters for your Symfony applications",
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"nette\/utils": "^3.2",
|
||||
"symfony\/dependency-injection": "^6.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5.25",
|
||||
"symplify\/package-builder": "^11.1.17",
|
||||
"symplify\/symplify-kernel": "^11.1.17"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202212\\Symplify\\AutowireArrayParameter\\": "src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202212\\Symplify\\AutowireArrayParameter\\Tests\\": "tests"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "11.2-dev"
|
||||
}
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/composer-json-manipulator": "<11.1.17",
|
||||
"symplify\/easy-coding-standard": "<11.1.17",
|
||||
"symplify\/phpstan-rules": "<11.1.17",
|
||||
"symplify\/easy-testing": "<11.1.17",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.17",
|
||||
"symplify\/php-config-printer": "<11.1.17",
|
||||
"symplify\/phpstan-extensions": "<11.1.17",
|
||||
"symplify\/rule-doc-generator": "<11.1.17",
|
||||
"symplify\/vendor-patches": "<11.1.17",
|
||||
"symplify\/smart-file-system": "<11.1.17",
|
||||
"symplify\/symfony-static-dumper": "<11.1.17",
|
||||
"symplify\/symplify-kernel": "<11.1.17",
|
||||
"symplify\/monorepo-builder": "<11.1.17",
|
||||
"symplify\/config-transformer": "<11.1.17",
|
||||
"symplify\/easy-ci": "<11.1.17",
|
||||
"symplify\/coding-standard": "<11.1.17",
|
||||
"symplify\/easy-parallel": "<11.1.17",
|
||||
"symplify\/package-builder": "<11.1.17"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user