mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 03:40:50 +00:00
Updated Rector to commit ca5b89baad
ca5b89baad
[Core] Refactor InfiniteLoopValidator (#1771)
This commit is contained in:
parent
6b7bb4ae18
commit
4d4eb2f2ad
|
@ -53,7 +53,7 @@ use RectorPrefix20220206\Symplify\SmartFileSystem\SmartFileSystem;
|
|||
return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->defaults()->public()->autowire()->autoconfigure();
|
||||
$services->load('Rector\\Core\\', __DIR__ . '/../src')->exclude([__DIR__ . '/../src/Rector', __DIR__ . '/../src/Exception', __DIR__ . '/../src/DependencyInjection/CompilerPass', __DIR__ . '/../src/DependencyInjection/Loader', __DIR__ . '/../src/Kernel', __DIR__ . '/../src/ValueObject', __DIR__ . '/../src/Bootstrap', __DIR__ . '/../src/Enum', __DIR__ . '/../src/PhpParser/Node/CustomNode', __DIR__ . '/../src/PhpParser/ValueObject', __DIR__ . '/../src/functions', __DIR__ . '/../src/constants.php', __DIR__ . '/../src/PhpParser/NodeVisitor/CreatedByRuleNodeVisitor.php']);
|
||||
$services->load('Rector\\Core\\', __DIR__ . '/../src')->exclude([__DIR__ . '/../src/Rector', __DIR__ . '/../src/Exception', __DIR__ . '/../src/DependencyInjection/CompilerPass', __DIR__ . '/../src/DependencyInjection/Loader', __DIR__ . '/../src/Kernel', __DIR__ . '/../src/ValueObject', __DIR__ . '/../src/Bootstrap', __DIR__ . '/../src/Enum', __DIR__ . '/../src/PhpParser/Node/CustomNode', __DIR__ . '/../src/PhpParser/ValueObject', __DIR__ . '/../src/functions', __DIR__ . '/../src/constants.php']);
|
||||
$services->alias(\RectorPrefix20220206\Symfony\Component\Console\Application::class, \Rector\Core\Console\ConsoleApplication::class);
|
||||
$services->set(\RectorPrefix20220206\Symplify\SmartFileSystem\FileSystemGuard::class);
|
||||
$services->set(\Rector\Core\Validation\Collector\EmptyConfigurableRectorCollector::class)->arg('$containerBuilder', \RectorPrefix20220206\Symfony\Component\DependencyInjection\Loader\Configurator\service('service_container'));
|
||||
|
|
|
@ -72,10 +72,6 @@ CODE_SAMPLE
|
|||
if (!($node->class instanceof \PhpParser\Node\Name && $this->nodeNameResolver->isName($node->class, 'Throwable'))) {
|
||||
return null;
|
||||
}
|
||||
$createdByRule = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CREATED_BY_RULE) ?? [];
|
||||
if (\in_array(self::class, $createdByRule, \true)) {
|
||||
return null;
|
||||
}
|
||||
// Ensure the refactoring is idempotent.
|
||||
if ($this->isAlreadyTransformed($node)) {
|
||||
return null;
|
||||
|
|
|
@ -88,10 +88,6 @@ CODE_SAMPLE
|
|||
if (!$this->isName($node, 'json_decode')) {
|
||||
return null;
|
||||
}
|
||||
$createdByRule = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CREATED_BY_RULE) ?? [];
|
||||
if (\in_array(self::class, $createdByRule, \true)) {
|
||||
return null;
|
||||
}
|
||||
$args = $node->getArgs();
|
||||
if ($this->argsAnalyzer->hasNamedArg($args)) {
|
||||
return null;
|
||||
|
|
|
@ -26,7 +26,6 @@ use PHPStan\Type\Constant\ConstantStringType;
|
|||
use PHPStan\Type\StringType;
|
||||
use Rector\Core\NodeAnalyzer\ArgsAnalyzer;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
|
@ -92,10 +91,6 @@ CODE_SAMPLE
|
|||
if (!isset($args[1])) {
|
||||
return null;
|
||||
}
|
||||
$createdByRule = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CREATED_BY_RULE) ?? [];
|
||||
if (\in_array(self::class, $createdByRule, \true)) {
|
||||
return null;
|
||||
}
|
||||
// direct null check ConstFetch
|
||||
if ($args[1]->value instanceof \PhpParser\Node\Expr\ConstFetch && $this->valueResolver->isNull($args[1]->value)) {
|
||||
$args = [$args[0]];
|
||||
|
|
|
@ -38,10 +38,6 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
|||
*/
|
||||
final class CountOnNullRector extends \Rector\Core\Rector\AbstractRector implements \Rector\VersionBonding\Contract\MinPhpVersionInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private const ALREADY_CHANGED_ON_COUNT = 'already_changed_on_count';
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\NodeTypeResolver\TypeAnalyzer\CountableTypeAnalyzer
|
||||
|
@ -117,10 +113,7 @@ CODE_SAMPLE
|
|||
}
|
||||
if ($this->nodeTypeResolver->isNullableType($countedNode) || $countedType instanceof \PHPStan\Type\NullType) {
|
||||
$identical = new \PhpParser\Node\Expr\BinaryOp\Identical($countedNode, $this->nodeFactory->createNull());
|
||||
$ternary = new \PhpParser\Node\Expr\Ternary($identical, new \PhpParser\Node\Scalar\LNumber(0), $node);
|
||||
// prevent infinity loop re-resolution
|
||||
$node->setAttribute(self::ALREADY_CHANGED_ON_COUNT, \true);
|
||||
return $ternary;
|
||||
return new \PhpParser\Node\Expr\Ternary($identical, new \PhpParser\Node\Scalar\LNumber(0), $node);
|
||||
}
|
||||
if ($this->phpVersionProvider->isAtLeastPhpVersion(\Rector\Core\ValueObject\PhpVersionFeature::IS_COUNTABLE)) {
|
||||
$conditionNode = new \PhpParser\Node\Expr\FuncCall(new \PhpParser\Node\Name('is_countable'), [new \PhpParser\Node\Arg($countedNode)]);
|
||||
|
@ -128,8 +121,6 @@ CODE_SAMPLE
|
|||
$instanceof = new \PhpParser\Node\Expr\Instanceof_($countedNode, new \PhpParser\Node\Name\FullyQualified('Countable'));
|
||||
$conditionNode = new \PhpParser\Node\Expr\BinaryOp\BooleanOr($this->nodeFactory->createFuncCall('is_array', [new \PhpParser\Node\Arg($countedNode)]), $instanceof);
|
||||
}
|
||||
// prevent infinity loop re-resolution
|
||||
$node->setAttribute(self::ALREADY_CHANGED_ON_COUNT, \true);
|
||||
return new \PhpParser\Node\Expr\Ternary($conditionNode, $node, new \PhpParser\Node\Scalar\LNumber(0));
|
||||
}
|
||||
private function isAlwaysIterableType(\PHPStan\Type\Type $possibleUnionType) : bool
|
||||
|
@ -162,11 +153,6 @@ CODE_SAMPLE
|
|||
if ($funcCall->args[0]->value instanceof \PhpParser\Node\Expr\ClassConstFetch) {
|
||||
return \true;
|
||||
}
|
||||
$alreadyChangedOnCount = (bool) $funcCall->getAttribute(self::ALREADY_CHANGED_ON_COUNT, \false);
|
||||
// check if it has some condition before already, if so, probably it's already handled
|
||||
if ($alreadyChangedOnCount) {
|
||||
return \true;
|
||||
}
|
||||
$parentNode = $funcCall->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
if ($parentNode instanceof \PhpParser\Node\Expr\Ternary) {
|
||||
return \true;
|
||||
|
|
|
@ -16,11 +16,11 @@ final class VersionResolver
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'aa4f45484afe2fed465946957a1dec9c38655c6b';
|
||||
public const PACKAGE_VERSION = 'ca5b89baadea89ea41ce64e79a39f13a5848f5ff';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-02-06 08:19:40';
|
||||
public const RELEASE_DATE = '2022-02-06 17:27:29';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20220206\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Core\Exception\NodeTraverser;
|
||||
|
||||
use Exception;
|
||||
final class InfiniteLoopTraversingException extends \Exception
|
||||
{
|
||||
}
|
|
@ -7,7 +7,20 @@ use PhpParser\Node;
|
|||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
final class CreatedByRuleDecorator
|
||||
{
|
||||
public function decorate(\PhpParser\Node $node, string $rectorClass) : void
|
||||
/**
|
||||
* @param mixed[]|\PhpParser\Node $node
|
||||
*/
|
||||
public function decorate($node, \PhpParser\Node $originalNode, string $rectorClass) : void
|
||||
{
|
||||
if ($node instanceof \PhpParser\Node) {
|
||||
$node = [$node];
|
||||
}
|
||||
foreach ($node as $singleNode) {
|
||||
$this->createByRule($singleNode, $rectorClass);
|
||||
}
|
||||
$this->createByRule($originalNode, $rectorClass);
|
||||
}
|
||||
private function createByRule(\PhpParser\Node $node, string $rectorClass) : void
|
||||
{
|
||||
$mergeCreatedByRule = \array_merge($node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CREATED_BY_RULE) ?? [], [$rectorClass]);
|
||||
$mergeCreatedByRule = \array_unique($mergeCreatedByRule);
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Core\PhpParser\NodeVisitor;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\NodeVisitorAbstract;
|
||||
use Rector\Core\NodeDecorator\CreatedByRuleDecorator;
|
||||
final class CreatedByRuleNodeVisitor extends \PhpParser\NodeVisitorAbstract
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\NodeDecorator\CreatedByRuleDecorator
|
||||
*/
|
||||
private $createdByRuleDecorator;
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $rectorClass;
|
||||
public function __construct(\Rector\Core\NodeDecorator\CreatedByRuleDecorator $createdByRuleDecorator, string $rectorClass)
|
||||
{
|
||||
$this->createdByRuleDecorator = $createdByRuleDecorator;
|
||||
$this->rectorClass = $rectorClass;
|
||||
}
|
||||
public function enterNode(\PhpParser\Node $node)
|
||||
{
|
||||
$this->createdByRuleDecorator->decorate($node, $this->rectorClass);
|
||||
return $node;
|
||||
}
|
||||
}
|
|
@ -241,21 +241,26 @@ abstract class AbstractRector extends \PhpParser\NodeVisitorAbstract implements
|
|||
$this->printDebugApplying();
|
||||
$originalAttributes = $node->getAttributes();
|
||||
$originalNode = $originalNode ?? clone $node;
|
||||
if (!$this->infiniteLoopValidator->isValid($node, $originalNode, static::class)) {
|
||||
return null;
|
||||
}
|
||||
$node = $this->refactor($node);
|
||||
// nothing to change → continue
|
||||
if ($node === null) {
|
||||
if ($this->isNothingToChange($node)) {
|
||||
return null;
|
||||
}
|
||||
/** @var Node|array<Node> $node */
|
||||
if (!$this->infiniteLoopValidator->isValid($node, $originalNode, static::class)) {
|
||||
return null;
|
||||
}
|
||||
/** @var Node $originalNode */
|
||||
if (\is_array($node)) {
|
||||
$this->createdByRule($node, $originalNode);
|
||||
$this->createdByRuleDecorator->decorate($node, $originalNode, static::class);
|
||||
$originalNodeHash = \spl_object_hash($originalNode);
|
||||
$this->nodesToReturn[$originalNodeHash] = $node;
|
||||
if ($node !== []) {
|
||||
\reset($node);
|
||||
$firstNodeKey = \key($node);
|
||||
$this->mirrorComments($node[$firstNodeKey], $originalNode);
|
||||
}
|
||||
\reset($node);
|
||||
$firstNodeKey = \key($node);
|
||||
$this->mirrorComments($node[$firstNodeKey], $originalNode);
|
||||
// will be replaced in leaveNode() the original node must be passed
|
||||
return $originalNode;
|
||||
}
|
||||
|
@ -268,14 +273,11 @@ abstract class AbstractRector extends \PhpParser\NodeVisitorAbstract implements
|
|||
// update parents relations - must run before connectParentNodes()
|
||||
$this->mirrorAttributes($originalAttributes, $node);
|
||||
$this->connectParentNodes($node);
|
||||
$this->createdByRuleDecorator->decorate($node, $originalNode, static::class);
|
||||
// is equals node type? return node early
|
||||
if (\get_class($originalNode) === \get_class($node)) {
|
||||
$this->createdByRule($node, $originalNode);
|
||||
return $node;
|
||||
}
|
||||
// is different node type? do not traverse children to avoid looping
|
||||
$this->infiniteLoopValidator->process($node, $originalNode, static::class);
|
||||
$this->createdByRuleDecorator->decorate($node, static::class);
|
||||
// search "infinite recursion" in https://github.com/nikic/PHP-Parser/blob/master/doc/component/Walking_the_AST.markdown
|
||||
$originalNodeHash = \spl_object_hash($originalNode);
|
||||
if ($originalNode instanceof \PhpParser\Node\Stmt && $node instanceof \PhpParser\Node\Expr) {
|
||||
|
@ -410,17 +412,14 @@ abstract class AbstractRector extends \PhpParser\NodeVisitorAbstract implements
|
|||
$this->nodeRemover->removeNodes($nodes);
|
||||
}
|
||||
/**
|
||||
* @param mixed[]|\PhpParser\Node $node
|
||||
* @param mixed[]|\PhpParser\Node|null $node
|
||||
*/
|
||||
private function createdByRule($node, \PhpParser\Node $originalNode) : void
|
||||
private function isNothingToChange($node) : bool
|
||||
{
|
||||
if ($node instanceof \PhpParser\Node) {
|
||||
$node = [$node];
|
||||
if ($node === null) {
|
||||
return \true;
|
||||
}
|
||||
foreach ($node as $singleNode) {
|
||||
$this->createdByRuleDecorator->decorate($singleNode, static::class);
|
||||
}
|
||||
$this->createdByRuleDecorator->decorate($originalNode, static::class);
|
||||
return $node === [];
|
||||
}
|
||||
/**
|
||||
* @param class-string<Node> $nodeClass
|
||||
|
|
|
@ -4,65 +4,44 @@ declare (strict_types=1);
|
|||
namespace Rector\Core\Validation;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\NodeTraverser;
|
||||
use Rector\Core\Contract\Rector\RectorInterface;
|
||||
use Rector\Core\Exception\NodeTraverser\InfiniteLoopTraversingException;
|
||||
use Rector\Core\NodeDecorator\CreatedByRuleDecorator;
|
||||
use Rector\Core\PhpParser\Comparing\NodeComparator;
|
||||
use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||
use Rector\Core\PhpParser\NodeVisitor\CreatedByRuleNodeVisitor;
|
||||
use Rector\DowngradePhp74\Rector\ArrowFunction\ArrowFunctionToAnonymousFunctionRector;
|
||||
use Rector\DowngradePhp80\Rector\NullsafeMethodCall\DowngradeNullsafeToTernaryOperatorRector;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
|
||||
final class InfiniteLoopValidator
|
||||
{
|
||||
/**
|
||||
* @var array<class-string<RectorInterface>>
|
||||
* @readonly
|
||||
* @var \Rector\Core\PhpParser\Comparing\NodeComparator
|
||||
*/
|
||||
private const ALLOWED_INFINITE_RECTOR_CLASSES = [\Rector\DowngradePhp80\Rector\NullsafeMethodCall\DowngradeNullsafeToTernaryOperatorRector::class, \Rector\DowngradePhp74\Rector\ArrowFunction\ArrowFunctionToAnonymousFunctionRector::class, \Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector::class];
|
||||
private $nodeComparator;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
|
||||
*/
|
||||
private $betterNodeFinder;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\NodeDecorator\CreatedByRuleDecorator
|
||||
*/
|
||||
private $createdByRuleDecorator;
|
||||
public function __construct(\Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\Core\NodeDecorator\CreatedByRuleDecorator $createdByRuleDecorator)
|
||||
public function __construct(\Rector\Core\PhpParser\Comparing\NodeComparator $nodeComparator, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder)
|
||||
{
|
||||
$this->nodeComparator = $nodeComparator;
|
||||
$this->betterNodeFinder = $betterNodeFinder;
|
||||
$this->createdByRuleDecorator = $createdByRuleDecorator;
|
||||
}
|
||||
/**
|
||||
* @param class-string<RectorInterface> $rectorClass
|
||||
* @param mixed[]|\PhpParser\Node $node
|
||||
*/
|
||||
public function process(\PhpParser\Node $node, \PhpParser\Node $originalNode, string $rectorClass) : void
|
||||
public function isValid($node, \PhpParser\Node $originalNode, string $rectorClass) : bool
|
||||
{
|
||||
if (\in_array($rectorClass, self::ALLOWED_INFINITE_RECTOR_CLASSES, \true)) {
|
||||
return;
|
||||
if ($this->nodeComparator->areNodesEqual($node, $originalNode)) {
|
||||
return \true;
|
||||
}
|
||||
$isFound = (bool) $this->betterNodeFinder->findFirst($node, function (\PhpParser\Node $subNode) use($node) : bool {
|
||||
return $this->nodeComparator->areNodesEqual($node, $subNode);
|
||||
});
|
||||
if (!$isFound) {
|
||||
return \true;
|
||||
}
|
||||
$createdByRule = $originalNode->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CREATED_BY_RULE) ?? [];
|
||||
// special case
|
||||
if (\in_array($rectorClass, $createdByRule, \true)) {
|
||||
// does it contain the same node type as input?
|
||||
$originalNodeClass = \get_class($originalNode);
|
||||
$hasNestedOriginalNodeType = $this->betterNodeFinder->findInstanceOf($node, $originalNodeClass);
|
||||
if ($hasNestedOriginalNodeType !== []) {
|
||||
throw new \Rector\Core\Exception\NodeTraverser\InfiniteLoopTraversingException($rectorClass);
|
||||
}
|
||||
if ($createdByRule === []) {
|
||||
return \true;
|
||||
}
|
||||
$this->decorateNode($originalNode, $rectorClass);
|
||||
}
|
||||
/**
|
||||
* @param class-string<RectorInterface> $rectorClass
|
||||
*/
|
||||
private function decorateNode(\PhpParser\Node $node, string $rectorClass) : void
|
||||
{
|
||||
$nodeTraverser = new \PhpParser\NodeTraverser();
|
||||
$createdByRuleNodeVisitor = new \Rector\Core\PhpParser\NodeVisitor\CreatedByRuleNodeVisitor($this->createdByRuleDecorator, $rectorClass);
|
||||
$nodeTraverser->addVisitor($createdByRuleNodeVisitor);
|
||||
$nodeTraverser->traverse([$node]);
|
||||
return !\in_array($rectorClass, $createdByRule, \true);
|
||||
}
|
||||
}
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -4,4 +4,4 @@
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit64804f93e5880c50981fdc91e7f4e7fe::getLoader();
|
||||
return ComposerAutoloaderInit4b50c3212c6733f12dc6b0c0cacd8625::getLoader();
|
||||
|
|
2
vendor/composer/autoload_classmap.php
vendored
2
vendor/composer/autoload_classmap.php
vendored
|
@ -1662,7 +1662,6 @@ return array(
|
|||
'Rector\\Core\\Error\\ExceptionCorrector' => $baseDir . '/src/Error/ExceptionCorrector.php',
|
||||
'Rector\\Core\\Exception\\Cache\\CachingException' => $baseDir . '/src/Exception/Cache/CachingException.php',
|
||||
'Rector\\Core\\Exception\\Configuration\\InvalidConfigurationException' => $baseDir . '/src/Exception/Configuration/InvalidConfigurationException.php',
|
||||
'Rector\\Core\\Exception\\NodeTraverser\\InfiniteLoopTraversingException' => $baseDir . '/src/Exception/NodeTraverser/InfiniteLoopTraversingException.php',
|
||||
'Rector\\Core\\Exception\\NotImplementedYetException' => $baseDir . '/src/Exception/NotImplementedYetException.php',
|
||||
'Rector\\Core\\Exception\\ShouldNotHappenException' => $baseDir . '/src/Exception/ShouldNotHappenException.php',
|
||||
'Rector\\Core\\Exception\\Template\\TemplateTypeNotFoundException' => $baseDir . '/src/Exception/Template/TemplateTypeNotFoundException.php',
|
||||
|
@ -1731,7 +1730,6 @@ return array(
|
|||
'Rector\\Core\\PhpParser\\NodeFinder\\PropertyFetchFinder' => $baseDir . '/src/PhpParser/NodeFinder/PropertyFetchFinder.php',
|
||||
'Rector\\Core\\PhpParser\\NodeTransformer' => $baseDir . '/src/PhpParser/NodeTransformer.php',
|
||||
'Rector\\Core\\PhpParser\\NodeTraverser\\RectorNodeTraverser' => $baseDir . '/src/PhpParser/NodeTraverser/RectorNodeTraverser.php',
|
||||
'Rector\\Core\\PhpParser\\NodeVisitor\\CreatedByRuleNodeVisitor' => $baseDir . '/src/PhpParser/NodeVisitor/CreatedByRuleNodeVisitor.php',
|
||||
'Rector\\Core\\PhpParser\\Node\\AssignAndBinaryMap' => $baseDir . '/src/PhpParser/Node/AssignAndBinaryMap.php',
|
||||
'Rector\\Core\\PhpParser\\Node\\BetterNodeFinder' => $baseDir . '/src/PhpParser/Node/BetterNodeFinder.php',
|
||||
'Rector\\Core\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace' => $baseDir . '/src/PhpParser/Node/CustomNode/FileWithoutNamespace.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 ComposerAutoloaderInit64804f93e5880c50981fdc91e7f4e7fe
|
||||
class ComposerAutoloaderInit4b50c3212c6733f12dc6b0c0cacd8625
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,15 +22,15 @@ class ComposerAutoloaderInit64804f93e5880c50981fdc91e7f4e7fe
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit64804f93e5880c50981fdc91e7f4e7fe', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit4b50c3212c6733f12dc6b0c0cacd8625', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit64804f93e5880c50981fdc91e7f4e7fe', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit4b50c3212c6733f12dc6b0c0cacd8625', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit64804f93e5880c50981fdc91e7f4e7fe::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit4b50c3212c6733f12dc6b0c0cacd8625::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
|
@ -42,12 +42,12 @@ class ComposerAutoloaderInit64804f93e5880c50981fdc91e7f4e7fe
|
|||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit64804f93e5880c50981fdc91e7f4e7fe::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit4b50c3212c6733f12dc6b0c0cacd8625::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire64804f93e5880c50981fdc91e7f4e7fe($fileIdentifier, $file);
|
||||
composerRequire4b50c3212c6733f12dc6b0c0cacd8625($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
|
@ -59,7 +59,7 @@ class ComposerAutoloaderInit64804f93e5880c50981fdc91e7f4e7fe
|
|||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire64804f93e5880c50981fdc91e7f4e7fe($fileIdentifier, $file)
|
||||
function composerRequire4b50c3212c6733f12dc6b0c0cacd8625($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
10
vendor/composer/autoload_static.php
vendored
10
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit64804f93e5880c50981fdc91e7f4e7fe
|
||||
class ComposerStaticInit4b50c3212c6733f12dc6b0c0cacd8625
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
|
@ -2052,7 +2052,6 @@ class ComposerStaticInit64804f93e5880c50981fdc91e7f4e7fe
|
|||
'Rector\\Core\\Error\\ExceptionCorrector' => __DIR__ . '/../..' . '/src/Error/ExceptionCorrector.php',
|
||||
'Rector\\Core\\Exception\\Cache\\CachingException' => __DIR__ . '/../..' . '/src/Exception/Cache/CachingException.php',
|
||||
'Rector\\Core\\Exception\\Configuration\\InvalidConfigurationException' => __DIR__ . '/../..' . '/src/Exception/Configuration/InvalidConfigurationException.php',
|
||||
'Rector\\Core\\Exception\\NodeTraverser\\InfiniteLoopTraversingException' => __DIR__ . '/../..' . '/src/Exception/NodeTraverser/InfiniteLoopTraversingException.php',
|
||||
'Rector\\Core\\Exception\\NotImplementedYetException' => __DIR__ . '/../..' . '/src/Exception/NotImplementedYetException.php',
|
||||
'Rector\\Core\\Exception\\ShouldNotHappenException' => __DIR__ . '/../..' . '/src/Exception/ShouldNotHappenException.php',
|
||||
'Rector\\Core\\Exception\\Template\\TemplateTypeNotFoundException' => __DIR__ . '/../..' . '/src/Exception/Template/TemplateTypeNotFoundException.php',
|
||||
|
@ -2121,7 +2120,6 @@ class ComposerStaticInit64804f93e5880c50981fdc91e7f4e7fe
|
|||
'Rector\\Core\\PhpParser\\NodeFinder\\PropertyFetchFinder' => __DIR__ . '/../..' . '/src/PhpParser/NodeFinder/PropertyFetchFinder.php',
|
||||
'Rector\\Core\\PhpParser\\NodeTransformer' => __DIR__ . '/../..' . '/src/PhpParser/NodeTransformer.php',
|
||||
'Rector\\Core\\PhpParser\\NodeTraverser\\RectorNodeTraverser' => __DIR__ . '/../..' . '/src/PhpParser/NodeTraverser/RectorNodeTraverser.php',
|
||||
'Rector\\Core\\PhpParser\\NodeVisitor\\CreatedByRuleNodeVisitor' => __DIR__ . '/../..' . '/src/PhpParser/NodeVisitor/CreatedByRuleNodeVisitor.php',
|
||||
'Rector\\Core\\PhpParser\\Node\\AssignAndBinaryMap' => __DIR__ . '/../..' . '/src/PhpParser/Node/AssignAndBinaryMap.php',
|
||||
'Rector\\Core\\PhpParser\\Node\\BetterNodeFinder' => __DIR__ . '/../..' . '/src/PhpParser/Node/BetterNodeFinder.php',
|
||||
'Rector\\Core\\PhpParser\\Node\\CustomNode\\FileWithoutNamespace' => __DIR__ . '/../..' . '/src/PhpParser/Node/CustomNode/FileWithoutNamespace.php',
|
||||
|
@ -3864,9 +3862,9 @@ class ComposerStaticInit64804f93e5880c50981fdc91e7f4e7fe
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit64804f93e5880c50981fdc91e7f4e7fe::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit64804f93e5880c50981fdc91e7f4e7fe::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit64804f93e5880c50981fdc91e7f4e7fe::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit4b50c3212c6733f12dc6b0c0cacd8625::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit4b50c3212c6733f12dc6b0c0cacd8625::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit4b50c3212c6733f12dc6b0c0cacd8625::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
|
@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
|
|||
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
|
||||
spl_autoload_call('RectorPrefix20220206\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInit64804f93e5880c50981fdc91e7f4e7fe', false) && !interface_exists('ComposerAutoloaderInit64804f93e5880c50981fdc91e7f4e7fe', false) && !trait_exists('ComposerAutoloaderInit64804f93e5880c50981fdc91e7f4e7fe', false)) {
|
||||
spl_autoload_call('RectorPrefix20220206\ComposerAutoloaderInit64804f93e5880c50981fdc91e7f4e7fe');
|
||||
if (!class_exists('ComposerAutoloaderInit4b50c3212c6733f12dc6b0c0cacd8625', false) && !interface_exists('ComposerAutoloaderInit4b50c3212c6733f12dc6b0c0cacd8625', false) && !trait_exists('ComposerAutoloaderInit4b50c3212c6733f12dc6b0c0cacd8625', false)) {
|
||||
spl_autoload_call('RectorPrefix20220206\ComposerAutoloaderInit4b50c3212c6733f12dc6b0c0cacd8625');
|
||||
}
|
||||
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
|
||||
spl_autoload_call('RectorPrefix20220206\Helmich\TypoScriptParser\Parser\AST\Statement');
|
||||
|
@ -71,9 +71,9 @@ if (!function_exists('print_node')) {
|
|||
return \RectorPrefix20220206\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequire64804f93e5880c50981fdc91e7f4e7fe')) {
|
||||
function composerRequire64804f93e5880c50981fdc91e7f4e7fe() {
|
||||
return \RectorPrefix20220206\composerRequire64804f93e5880c50981fdc91e7f4e7fe(...func_get_args());
|
||||
if (!function_exists('composerRequire4b50c3212c6733f12dc6b0c0cacd8625')) {
|
||||
function composerRequire4b50c3212c6733f12dc6b0c0cacd8625() {
|
||||
return \RectorPrefix20220206\composerRequire4b50c3212c6733f12dc6b0c0cacd8625(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('scanPath')) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user