From c76f97bfb28094dbf1545fd3be46e635c4ad2929 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 5 Nov 2021 14:38:48 +0000 Subject: [PATCH] Updated Rector to commit 49aa15dbfb1932401ae68310c4064c273259ea4e https://github.com/rectorphp/rector-src/commit/49aa15dbfb1932401ae68310c4064c273259ea4e [CodingStyle] Deprecate RemoveUnusedAliasRector, job rather for coding standard tool and opinonated (#1157) --- config/set/coding-style.php | 2 - docs/rector_rules_overview.md | 42 ++-- .../NodeAnalyzer/UseAnalyzer.php | 106 --------- .../ValueObject/NameAndParent.php | 47 ---- rules/CodingStyle/Naming/NameRenamer.php | 199 ---------------- rules/CodingStyle/Node/DocAliasResolver.php | 85 ------- .../Node/UseNameAliasToNameResolver.php | 43 ---- .../Rector/Use_/RemoveUnusedAliasRector.php | 222 ------------------ src/Application/VersionResolver.php | 4 +- .../FullyQualifiedFromUseFinder.php | 38 --- vendor/autoload.php | 2 +- vendor/composer/autoload_classmap.php | 7 - vendor/composer/autoload_real.php | 14 +- vendor/composer/autoload_static.php | 15 +- vendor/scoper-autoload.php | 10 +- 15 files changed, 41 insertions(+), 795 deletions(-) delete mode 100644 packages/NameImporting/NodeAnalyzer/UseAnalyzer.php delete mode 100644 packages/NameImporting/ValueObject/NameAndParent.php delete mode 100644 rules/CodingStyle/Naming/NameRenamer.php delete mode 100644 rules/CodingStyle/Node/DocAliasResolver.php delete mode 100644 rules/CodingStyle/Node/UseNameAliasToNameResolver.php delete mode 100644 rules/CodingStyle/Rector/Use_/RemoveUnusedAliasRector.php delete mode 100644 src/PhpParser/NodeFinder/FullyQualifiedFromUseFinder.php diff --git a/config/set/coding-style.php b/config/set/coding-style.php index 0efa02fd773..61493db949c 100644 --- a/config/set/coding-style.php +++ b/config/set/coding-style.php @@ -31,7 +31,6 @@ use Rector\CodingStyle\Rector\String_\SplitStringClassConstantToClassConstFetchR use Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector; use Rector\CodingStyle\Rector\Switch_\BinarySwitchToIfElseRector; use Rector\CodingStyle\Rector\Ternary\TernaryConditionVariableAssignmentRector; -use Rector\CodingStyle\Rector\Use_\RemoveUnusedAliasRector; use Rector\CodingStyle\Rector\Use_\SeparateMultiUseImportsRector; use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; use Rector\Transform\Rector\FuncCall\FuncCallToConstFetchRector; @@ -43,7 +42,6 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat $services->set(\Rector\CodingStyle\Rector\Switch_\BinarySwitchToIfElseRector::class); $services->set(\Rector\CodingStyle\Rector\FuncCall\ConsistentImplodeRector::class); $services->set(\Rector\CodingStyle\Rector\Ternary\TernaryConditionVariableAssignmentRector::class); - $services->set(\Rector\CodingStyle\Rector\Use_\RemoveUnusedAliasRector::class); $services->set(\Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector::class); $services->set(\Rector\CodingStyle\Rector\ClassConst\SplitGroupedConstantsAndPropertiesRector::class); $services->set(\Rector\CodingStyle\Rector\String_\SplitStringClassConstantToClassConstFetchRector::class); diff --git a/docs/rector_rules_overview.md b/docs/rector_rules_overview.md index 29896715e1c..1980c12a3d5 100644 --- a/docs/rector_rules_overview.md +++ b/docs/rector_rules_overview.md @@ -12,7 +12,7 @@ - [CodeQuality](#codequality) (69) -- [CodingStyle](#codingstyle) (39) +- [CodingStyle](#codingstyle) (38) - [Composer](#composer) (6) @@ -76,7 +76,7 @@ - [Php80](#php80) (17) -- [Php81](#php81) (5) +- [Php81](#php81) (6) - [PhpSpecToPHPUnit](#phpspectophpunit) (7) @@ -2352,24 +2352,6 @@ Non-magic PHP object methods cannot start with "__"
-### RemoveUnusedAliasRector - -Removes unused use aliases. Keep annotation aliases like "Doctrine\ORM\Mapping as ORM" to keep convention format - -- class: [`Rector\CodingStyle\Rector\Use_\RemoveUnusedAliasRector`](../rules/CodingStyle/Rector/Use_/RemoveUnusedAliasRector.php) - -```diff --use Symfony\Kernel as BaseKernel; -+use Symfony\Kernel; - --class SomeClass extends BaseKernel -+class SomeClass extends Kernel - { - } -``` - -
- ### ReturnArrayClassMethodToYieldRector Turns array return to yield return in specific type and method @@ -8025,6 +8007,26 @@ Refactor MyCLabs enum fetch to Enum const
+### Php81ResourceReturnToObjectRector + +Change `is_resource()` to instanceof Object + +- class: [`Rector\Php81\Rector\FuncCall\Php81ResourceReturnToObjectRector`](../rules/Php81/Rector/FuncCall/Php81ResourceReturnToObjectRector.php) + +```diff + class SomeClass + { + public function run() + { + $f = finfo_open(); +- is_resource($f); ++ $f instanceof \finfo; + } + } +``` + +
+ ### ReadOnlyPropertyRector Decorate read-only property with `readonly` attribute diff --git a/packages/NameImporting/NodeAnalyzer/UseAnalyzer.php b/packages/NameImporting/NodeAnalyzer/UseAnalyzer.php deleted file mode 100644 index 5e683a6ca78..00000000000 --- a/packages/NameImporting/NodeAnalyzer/UseAnalyzer.php +++ /dev/null @@ -1,106 +0,0 @@ -betterNodeFinder = $betterNodeFinder; - $this->nodeNameResolver = $nodeNameResolver; - } - /** - * @return NameAndParent[] - */ - public function resolveUsedNameNodes(\PhpParser\Node $node) : array - { - $usedNames = $this->resolveUsedNames($node); - $usedClassNames = $this->resolveUsedClassNames($node); - $usedTraitNames = $this->resolveTraitUseNames($node); - return \array_merge($usedNames, $usedClassNames, $usedTraitNames); - } - /** - * @return NameAndParent[] - */ - private function resolveUsedNames(\PhpParser\Node $node) : array - { - $namesAndParents = []; - /** @var Name[] $names */ - $names = $this->betterNodeFinder->findInstanceOf($node, \PhpParser\Node\Name::class); - foreach ($names as $name) { - /** node name before becoming FQN - attribute from @see NameResolver */ - $originalName = $name->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::ORIGINAL_NAME); - if (!$originalName instanceof \PhpParser\Node\Name) { - continue; - } - $parentNode = $name->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE); - if (!$parentNode instanceof \PhpParser\Node) { - throw new \Rector\Core\Exception\ShouldNotHappenException(); - } - $shortName = $originalName->toString(); - $namesAndParents[] = new \Rector\NameImporting\ValueObject\NameAndParent($shortName, $name, $parentNode); - } - return $namesAndParents; - } - /** - * @return NameAndParent[] - */ - private function resolveUsedClassNames(\PhpParser\Node $node) : array - { - $namesAndParents = []; - /** @var ClassLike[] $classLikes */ - $classLikes = $this->betterNodeFinder->findClassLikes($node); - foreach ($classLikes as $classLike) { - $classLikeName = $classLike->name; - if (!$classLikeName instanceof \PhpParser\Node\Identifier) { - continue; - } - $name = $this->nodeNameResolver->getName($classLikeName); - if (!\is_string($name)) { - continue; - } - $namesAndParents[] = new \Rector\NameImporting\ValueObject\NameAndParent($name, $classLikeName, $classLike); - } - return $namesAndParents; - } - /** - * @return NameAndParent[] - */ - private function resolveTraitUseNames(\PhpParser\Node $node) : array - { - $namesAndParents = []; - /** @var Identifier[] $identifiers */ - $identifiers = $this->betterNodeFinder->findInstanceOf($node, \PhpParser\Node\Identifier::class); - foreach ($identifiers as $identifier) { - $parentNode = $identifier->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE); - if (!$parentNode instanceof \PhpParser\Node\Stmt\UseUse) { - continue; - } - $shortName = $identifier->name; - $namesAndParents[] = new \Rector\NameImporting\ValueObject\NameAndParent($shortName, $identifier, $parentNode); - } - return $namesAndParents; - } -} diff --git a/packages/NameImporting/ValueObject/NameAndParent.php b/packages/NameImporting/ValueObject/NameAndParent.php deleted file mode 100644 index a4bc1087a97..00000000000 --- a/packages/NameImporting/ValueObject/NameAndParent.php +++ /dev/null @@ -1,47 +0,0 @@ -shortName = $shortName; - $this->nameNode = $nameNode; - $this->parentNode = $parentNode; - } - /** - * @return \PhpParser\Node\Identifier|\PhpParser\Node\Name - */ - public function getNameNode() - { - return $this->nameNode; - } - public function getParentNode() : \PhpParser\Node - { - return $this->parentNode; - } - public function matchShortName(string $desiredShortName) : bool - { - return \strtolower($this->shortName) === \strtolower($desiredShortName); - } -} diff --git a/rules/CodingStyle/Naming/NameRenamer.php b/rules/CodingStyle/Naming/NameRenamer.php deleted file mode 100644 index 338d728f0aa..00000000000 --- a/rules/CodingStyle/Naming/NameRenamer.php +++ /dev/null @@ -1,199 +0,0 @@ -nodeNameResolver = $nodeNameResolver; - } - /** - * @param NameAndParent[] $namesAndParent - */ - public function renameNameNode(array $namesAndParent, string $lastName) : void - { - foreach ($namesAndParent as $nameAndParent) { - $parentNode = $nameAndParent->getParentNode(); - $usedName = $nameAndParent->getNameNode(); - if ($parentNode instanceof \PhpParser\Node\Stmt\TraitUse) { - $this->renameTraitUse($lastName, $parentNode, $usedName); - } - if ($parentNode instanceof \PhpParser\Node\Stmt\Class_) { - $this->renameClass($lastName, $parentNode, $usedName); - } - if ($parentNode instanceof \PhpParser\Node\Param) { - $this->renameParam($lastName, $parentNode, $usedName); - } - if ($parentNode instanceof \PhpParser\Node\Expr\New_) { - $this->renameNew($lastName, $parentNode, $usedName); - } - if ($parentNode instanceof \PhpParser\Node\Stmt\ClassMethod) { - $this->renameClassMethod($lastName, $parentNode, $usedName); - } - if ($parentNode instanceof \PhpParser\Node\Stmt\Interface_) { - $this->renameInterface($lastName, $parentNode, $usedName); - } - if ($parentNode instanceof \PhpParser\Node\Expr\StaticCall) { - $this->renameStaticCall($lastName, $parentNode); - } - if ($parentNode instanceof \PhpParser\Node\UnionType) { - $this->renameUnionType($lastName, $parentNode, $usedName); - } - if ($parentNode instanceof \PhpParser\Node\NullableType) { - $this->renameNullableType($lastName, $parentNode, $usedName); - } - if ($parentNode instanceof \PhpParser\Node\Expr\Instanceof_) { - $this->renameInInstanceOf($lastName, $parentNode, $usedName); - } - if ($parentNode instanceof \PhpParser\Node\Expr\ClassConstFetch) { - $this->renameClassConstFetch($lastName, $parentNode, $usedName); - } - } - } - /** - * @param \PhpParser\Node\Identifier|\PhpParser\Node\Name $usedNameNode - */ - private function renameClassConstFetch(string $lastName, \PhpParser\Node\Expr\ClassConstFetch $classConstFetch, $usedNameNode) : void - { - if (!$this->nodeNameResolver->areNamesEqual($classConstFetch->class, $usedNameNode)) { - return; - } - $classConstFetch->class = new \PhpParser\Node\Name($lastName); - } - /** - * @param \PhpParser\Node\Identifier|\PhpParser\Node\Name $usedNameNode - */ - private function renameInInstanceOf(string $lastName, \PhpParser\Node\Expr\Instanceof_ $instanceof, $usedNameNode) : void - { - if (!$this->nodeNameResolver->areNamesEqual($instanceof->class, $usedNameNode)) { - return; - } - $instanceof->class = new \PhpParser\Node\Name($lastName); - } - /** - * @param \PhpParser\Node\Identifier|\PhpParser\Node\Name $usedNameNode - */ - private function renameNullableType(string $lastName, \PhpParser\Node\NullableType $nullableType, $usedNameNode) : void - { - if (!$this->nodeNameResolver->areNamesEqual($nullableType->type, $usedNameNode)) { - return; - } - $nullableType->type = new \PhpParser\Node\Name($lastName); - } - /** - * @param \PhpParser\Node\Identifier|\PhpParser\Node\Name $usedNameNode - */ - private function renameTraitUse(string $lastName, \PhpParser\Node\Stmt\TraitUse $traitUse, $usedNameNode) : void - { - foreach ($traitUse->traits as $key => $traitName) { - if (!$this->nodeNameResolver->areNamesEqual($traitName, $usedNameNode)) { - continue; - } - $traitUse->traits[$key] = new \PhpParser\Node\Name($lastName); - } - } - /** - * @param \PhpParser\Node\Identifier|\PhpParser\Node\Name $usedNameNode - */ - private function renameClass(string $lastName, \PhpParser\Node\Stmt\Class_ $class, $usedNameNode) : void - { - if ($class->name !== null && $this->nodeNameResolver->areNamesEqual($class->name, $usedNameNode)) { - $class->name = new \PhpParser\Node\Identifier($lastName); - } - if ($class->extends !== null && $this->nodeNameResolver->areNamesEqual($class->extends, $usedNameNode)) { - $class->extends = new \PhpParser\Node\Name($lastName); - } - foreach ($class->implements as $key => $implementNode) { - if ($this->nodeNameResolver->areNamesEqual($implementNode, $usedNameNode)) { - $class->implements[$key] = new \PhpParser\Node\Name($lastName); - } - } - } - /** - * @param \PhpParser\Node\Identifier|\PhpParser\Node\Name $usedNameNode - */ - private function renameParam(string $lastName, \PhpParser\Node\Param $param, $usedNameNode) : void - { - if ($param->type === null) { - return; - } - if (!$this->nodeNameResolver->areNamesEqual($param->type, $usedNameNode)) { - return; - } - $param->type = new \PhpParser\Node\Name($lastName); - } - /** - * @param \PhpParser\Node\Identifier|\PhpParser\Node\Name $usedNameNode - */ - private function renameUnionType(string $lastName, \PhpParser\Node\UnionType $unionType, $usedNameNode) : void - { - foreach ($unionType->types as $key => $unionedType) { - if (!$this->nodeNameResolver->areNamesEqual($unionedType, $usedNameNode)) { - continue; - } - if (!$unionedType instanceof \PhpParser\Node\Name) { - continue; - } - $unionType->types[$key] = new \PhpParser\Node\Name($lastName); - } - } - /** - * @param \PhpParser\Node\Identifier|\PhpParser\Node\Name $usedNameNode - */ - private function renameNew(string $lastName, \PhpParser\Node\Expr\New_ $new, $usedNameNode) : void - { - if ($this->nodeNameResolver->areNamesEqual($new->class, $usedNameNode)) { - $new->class = new \PhpParser\Node\Name($lastName); - } - } - /** - * @param \PhpParser\Node\Identifier|\PhpParser\Node\Name $usedNameNode - */ - private function renameClassMethod(string $lastName, \PhpParser\Node\Stmt\ClassMethod $classMethod, $usedNameNode) : void - { - if ($classMethod->returnType === null) { - return; - } - if (!$this->nodeNameResolver->areNamesEqual($classMethod->returnType, $usedNameNode)) { - return; - } - $classMethod->returnType = new \PhpParser\Node\Name($lastName); - } - /** - * @param \PhpParser\Node\Identifier|\PhpParser\Node\Name $usedNameNode - */ - private function renameInterface(string $lastName, \PhpParser\Node\Stmt\Interface_ $interface, $usedNameNode) : void - { - foreach ($interface->extends as $key => $extendInterfaceName) { - if (!$this->nodeNameResolver->areNamesEqual($extendInterfaceName, $usedNameNode)) { - continue; - } - $interface->extends[$key] = new \PhpParser\Node\Name($lastName); - } - } - private function renameStaticCall(string $lastName, \PhpParser\Node\Expr\StaticCall $staticCall) : void - { - $staticCall->class = new \PhpParser\Node\Name($lastName); - } -} diff --git a/rules/CodingStyle/Node/DocAliasResolver.php b/rules/CodingStyle/Node/DocAliasResolver.php deleted file mode 100644 index a7d2b00ccc9..00000000000 --- a/rules/CodingStyle/Node/DocAliasResolver.php +++ /dev/null @@ -1,85 +0,0 @@ -\\w+)(\\\\)?#s'; - /** - * @var \Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser - */ - private $simpleCallableNodeTraverser; - /** - * @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory - */ - private $phpDocInfoFactory; - public function __construct(\RectorPrefix20211105\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser $simpleCallableNodeTraverser, \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory $phpDocInfoFactory) - { - $this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser; - $this->phpDocInfoFactory = $phpDocInfoFactory; - } - /** - * @return string[] - */ - public function resolve(\PhpParser\Node $node) : array - { - $possibleDocAliases = []; - $this->simpleCallableNodeTraverser->traverseNodesWithCallable($node, function (\PhpParser\Node $node) use(&$possibleDocAliases) : void { - $docComment = $node->getDocComment(); - if (!$docComment instanceof \PhpParser\Comment\Doc) { - return; - } - $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node); - $possibleDocAliases = $this->collectVarType($phpDocInfo, $possibleDocAliases); - // e.g. "use Dotrine\ORM\Mapping as ORM" etc. - $matches = \RectorPrefix20211105\Nette\Utils\Strings::matchAll($docComment->getText(), self::DOC_ALIAS_REGEX); - foreach ($matches as $match) { - $possibleDocAliases[] = $match['possible_alias']; - } - }); - return \array_unique($possibleDocAliases); - } - /** - * @param string[] $possibleDocAliases - * @return string[] - */ - private function collectVarType(\Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo $phpDocInfo, array $possibleDocAliases) : array - { - $possibleDocAliases = $this->appendPossibleAliases($phpDocInfo->getVarType(), $possibleDocAliases); - $possibleDocAliases = $this->appendPossibleAliases($phpDocInfo->getReturnType(), $possibleDocAliases); - foreach ($phpDocInfo->getParamTypesByName() as $paramType) { - $possibleDocAliases = $this->appendPossibleAliases($paramType, $possibleDocAliases); - } - return $possibleDocAliases; - } - /** - * @param string[] $possibleDocAliases - * @return string[] - */ - private function appendPossibleAliases(\PHPStan\Type\Type $varType, array $possibleDocAliases) : array - { - if ($varType instanceof \Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType) { - $possibleDocAliases[] = $varType->getClassName(); - } - if ($varType instanceof \PHPStan\Type\UnionType) { - foreach ($varType->getTypes() as $type) { - $possibleDocAliases = $this->appendPossibleAliases($type, $possibleDocAliases); - } - } - return $possibleDocAliases; - } -} diff --git a/rules/CodingStyle/Node/UseNameAliasToNameResolver.php b/rules/CodingStyle/Node/UseNameAliasToNameResolver.php deleted file mode 100644 index 6ba3a6fcb1d..00000000000 --- a/rules/CodingStyle/Node/UseNameAliasToNameResolver.php +++ /dev/null @@ -1,43 +0,0 @@ -classNaming = $classNaming; - $this->shortNameResolver = $shortNameResolver; - } - /** - * @return array - */ - public function resolve(\Rector\Core\ValueObject\Application\File $file) : array - { - $useNamesAliasToName = []; - $shortNames = $this->shortNameResolver->resolveFromFile($file); - foreach ($shortNames as $alias => $useImport) { - if (!\is_string($alias)) { - continue; - } - $shortName = $this->classNaming->getShortName($useImport); - if ($shortName === $alias) { - continue; - } - $useNamesAliasToName[$shortName][] = $alias; - } - return $useNamesAliasToName; - } -} diff --git a/rules/CodingStyle/Rector/Use_/RemoveUnusedAliasRector.php b/rules/CodingStyle/Rector/Use_/RemoveUnusedAliasRector.php deleted file mode 100644 index 283575ee08b..00000000000 --- a/rules/CodingStyle/Rector/Use_/RemoveUnusedAliasRector.php +++ /dev/null @@ -1,222 +0,0 @@ - - */ - private $useNamesAliasToName = []; - /** - * @var string[] - */ - private $resolvedDocPossibleAliases = []; - /** - * @var \Rector\CodingStyle\Node\DocAliasResolver - */ - private $docAliasResolver; - /** - * @var \Rector\NameImporting\NodeAnalyzer\UseAnalyzer - */ - private $useAnalyzer; - /** - * @var \Rector\CodingStyle\Node\UseNameAliasToNameResolver - */ - private $useNameAliasToNameResolver; - /** - * @var \Rector\CodingStyle\Naming\NameRenamer - */ - private $nameRenamer; - /** - * @var \Rector\CodingStyle\ClassNameImport\ClassNameImportSkipper - */ - private $classNameImportSkipper; - /** - * @var \Rector\Core\PhpParser\NodeFinder\FullyQualifiedFromUseFinder - */ - private $fullyQualifiedFromUseFinder; - public function __construct(\Rector\CodingStyle\Node\DocAliasResolver $docAliasResolver, \Rector\NameImporting\NodeAnalyzer\UseAnalyzer $useAnalyzer, \Rector\CodingStyle\Node\UseNameAliasToNameResolver $useNameAliasToNameResolver, \Rector\CodingStyle\Naming\NameRenamer $nameRenamer, \Rector\CodingStyle\ClassNameImport\ClassNameImportSkipper $classNameImportSkipper, \Rector\Core\PhpParser\NodeFinder\FullyQualifiedFromUseFinder $fullyQualifiedFromUseFinder) - { - $this->docAliasResolver = $docAliasResolver; - $this->useAnalyzer = $useAnalyzer; - $this->useNameAliasToNameResolver = $useNameAliasToNameResolver; - $this->nameRenamer = $nameRenamer; - $this->classNameImportSkipper = $classNameImportSkipper; - $this->fullyQualifiedFromUseFinder = $fullyQualifiedFromUseFinder; - } - public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition - { - return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Removes unused use aliases. Keep annotation aliases like "Doctrine\\ORM\\Mapping as ORM" to keep convention format', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE' -use Symfony\Kernel as BaseKernel; - -class SomeClass extends BaseKernel -{ -} -CODE_SAMPLE -, <<<'CODE_SAMPLE' -use Symfony\Kernel; - -class SomeClass extends Kernel -{ -} -CODE_SAMPLE -)]); - } - /** - * @return array> - */ - public function getNodeTypes() : array - { - return [\PhpParser\Node\Stmt\Use_::class]; - } - /** - * @param Use_ $node - */ - public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node - { - if ($this->shouldSkipUse($node)) { - return null; - } - $searchNode = $this->resolveSearchNode($node); - if (!$searchNode instanceof \PhpParser\Node) { - return null; - } - $this->namesAndParents = $this->useAnalyzer->resolveUsedNameNodes($searchNode); - $this->resolvedDocPossibleAliases = $this->docAliasResolver->resolve($searchNode); - $this->useNamesAliasToName = $this->useNameAliasToNameResolver->resolve($this->file); - // lowercase - $this->resolvedDocPossibleAliases = $this->lowercaseArray($this->resolvedDocPossibleAliases); - $this->useNamesAliasToName = \array_change_key_case($this->useNamesAliasToName, \CASE_LOWER); - foreach ($node->uses as $use) { - if ($use->alias === null) { - continue; - } - $lastName = $use->name->getLast(); - /** @var string $aliasName */ - $aliasName = $this->getName($use->alias); - if ($this->shouldSkip($node, $lastName, $aliasName)) { - continue; - } - // only last name is used → no need for alias - $matchedNamesAndParents = $this->matchNamesAndParentsByShort($lastName); - if ($matchedNamesAndParents !== []) { - $use->alias = null; - continue; - } - $this->refactorAliasName($node, $use->name->toString(), $lastName, $use); - } - return $node; - } - private function shouldSkipUse(\PhpParser\Node\Stmt\Use_ $use) : bool - { - // skip cases without namespace, problematic to analyse - $namespace = $this->betterNodeFinder->findParentType($use, \PhpParser\Node\Stmt\Namespace_::class); - if (!$namespace instanceof \PhpParser\Node) { - return \true; - } - return !$this->hasUseAlias($use); - } - /** - * @param string[] $values - * @return string[] - */ - private function lowercaseArray(array $values) : array - { - return \array_map('strtolower', $values); - } - private function shouldSkip(\PhpParser\Node\Stmt\Use_ $use, string $lastName, string $aliasName) : bool - { - // PHP is case insensitive - $loweredLastName = \strtolower($lastName); - $loweredAliasName = \strtolower($aliasName); - // both are used → nothing to remove - if ($this->areBothShortNamesUsed($loweredLastName, $loweredLastName)) { - return \true; - } - // part of some @Doc annotation - if (\in_array($loweredAliasName, $this->resolvedDocPossibleAliases, \true)) { - return \true; - } - return (bool) $this->fullyQualifiedFromUseFinder->matchAliasNamespace($use, $loweredAliasName); - } - private function refactorAliasName(\PhpParser\Node\Stmt\Use_ $use, string $fullUseUseName, string $lastName, \PhpParser\Node\Stmt\UseUse $useUse) : void - { - $parentUse = $use->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE); - if (!$parentUse instanceof \PhpParser\Node) { - return; - } - /** @var Use_[] $uses */ - $uses = $this->betterNodeFinder->find($parentUse, function (\PhpParser\Node $node) use($use) : bool { - if ($node === $use) { - return \false; - } - return $node instanceof \PhpParser\Node\Stmt\Use_; - }); - if ($this->classNameImportSkipper->isShortNameInUseStatement(new \PhpParser\Node\Name($lastName), $uses)) { - return; - } - $parentsAndNames = $this->matchNamesAndParentsByShort($fullUseUseName); - if ($parentsAndNames === []) { - return; - } - $this->nameRenamer->renameNameNode($parentsAndNames, $lastName); - $useUse->alias = null; - } - private function hasUseAlias(\PhpParser\Node\Stmt\Use_ $use) : bool - { - foreach ($use->uses as $useUse) { - if ($useUse->alias !== null) { - return \true; - } - } - return \false; - } - private function resolveSearchNode(\PhpParser\Node\Stmt\Use_ $use) : ?\PhpParser\Node - { - $searchNode = $use->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE); - if ($searchNode !== null) { - return $searchNode; - } - return $use->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE); - } - private function areBothShortNamesUsed(string $firstName, string $secondName) : bool - { - $firstNamesAndParents = $this->matchNamesAndParentsByShort($firstName); - $secondNamesAndParents = $this->matchNamesAndParentsByShort($secondName); - return $firstNamesAndParents !== [] && $secondNamesAndParents !== []; - } - /** - * @return NameAndParent[] - */ - private function matchNamesAndParentsByShort(string $shortName) : array - { - return \array_filter($this->namesAndParents, function (\Rector\NameImporting\ValueObject\NameAndParent $nameAndParent) use($shortName) : bool { - return $nameAndParent->matchShortName($shortName); - }); - } -} diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index d96c32c0e3a..db1e22dfe79 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -16,11 +16,11 @@ final class VersionResolver /** * @var string */ - public const PACKAGE_VERSION = '0c3527ebd8f871d71119b46e00cb001680fe76c1'; + public const PACKAGE_VERSION = '49aa15dbfb1932401ae68310c4064c273259ea4e'; /** * @var string */ - public const RELEASE_DATE = '2021-11-05 14:37:43'; + public const RELEASE_DATE = '2021-11-05 14:19:53'; public static function resolvePackageVersion() : string { $process = new \RectorPrefix20211105\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__); diff --git a/src/PhpParser/NodeFinder/FullyQualifiedFromUseFinder.php b/src/PhpParser/NodeFinder/FullyQualifiedFromUseFinder.php deleted file mode 100644 index e310ae96e24..00000000000 --- a/src/PhpParser/NodeFinder/FullyQualifiedFromUseFinder.php +++ /dev/null @@ -1,38 +0,0 @@ -betterNodeFinder = $betterNodeFinder; - } - public function matchAliasNamespace(\PhpParser\Node\Stmt\Use_ $use, string $loweredAliasName) : ?\PhpParser\Node - { - return $this->betterNodeFinder->findFirstNext($use, function (\PhpParser\Node $node) use($loweredAliasName) : bool { - if (!$node instanceof \PhpParser\Node\Name\FullyQualified) { - return \false; - } - $originalName = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::ORIGINAL_NAME); - if (!$originalName instanceof \PhpParser\Node\Name) { - return \false; - } - $loweredOriginalName = \strtolower($originalName->toString()); - $loweredOriginalNameNamespace = \RectorPrefix20211105\Nette\Utils\Strings::before($loweredOriginalName, '\\'); - return $loweredAliasName === $loweredOriginalNameNamespace; - }); - } -} diff --git a/vendor/autoload.php b/vendor/autoload.php index b7009601d28..c326ff9ab3d 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit7ca76728edb0a984003398e31dc50a90::getLoader(); +return ComposerAutoloaderInit1597e5290d82f782f1db9173ddac309a::getLoader(); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 3e9693cf76e..011a029b17b 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -1410,7 +1410,6 @@ return array( 'Rector\\CodingStyle\\Contract\\ClassNameImport\\ClassNameImportSkipVoterInterface' => $baseDir . '/rules/CodingStyle/Contract/ClassNameImport/ClassNameImportSkipVoterInterface.php', 'Rector\\CodingStyle\\Enum\\PreferenceSelfThis' => $baseDir . '/rules/CodingStyle/Enum/PreferenceSelfThis.php', 'Rector\\CodingStyle\\Naming\\ClassNaming' => $baseDir . '/rules/CodingStyle/Naming/ClassNaming.php', - 'Rector\\CodingStyle\\Naming\\NameRenamer' => $baseDir . '/rules/CodingStyle/Naming/NameRenamer.php', 'Rector\\CodingStyle\\NodeAnalyzer\\ImplodeAnalyzer' => $baseDir . '/rules/CodingStyle/NodeAnalyzer/ImplodeAnalyzer.php', 'Rector\\CodingStyle\\NodeAnalyzer\\SpreadVariablesCollector' => $baseDir . '/rules/CodingStyle/NodeAnalyzer/SpreadVariablesCollector.php', 'Rector\\CodingStyle\\NodeAnalyzer\\UseImportNameMatcher' => $baseDir . '/rules/CodingStyle/NodeAnalyzer/UseImportNameMatcher.php', @@ -1419,9 +1418,7 @@ return array( 'Rector\\CodingStyle\\NodeFactory\\JsonEncodeStaticCallFactory' => $baseDir . '/rules/CodingStyle/NodeFactory/JsonEncodeStaticCallFactory.php', 'Rector\\CodingStyle\\Node\\ConcatJoiner' => $baseDir . '/rules/CodingStyle/Node/ConcatJoiner.php', 'Rector\\CodingStyle\\Node\\ConcatManipulator' => $baseDir . '/rules/CodingStyle/Node/ConcatManipulator.php', - 'Rector\\CodingStyle\\Node\\DocAliasResolver' => $baseDir . '/rules/CodingStyle/Node/DocAliasResolver.php', 'Rector\\CodingStyle\\Node\\NameImporter' => $baseDir . '/rules/CodingStyle/Node/NameImporter.php', - 'Rector\\CodingStyle\\Node\\UseNameAliasToNameResolver' => $baseDir . '/rules/CodingStyle/Node/UseNameAliasToNameResolver.php', 'Rector\\CodingStyle\\Rector\\Assign\\ManualJsonStringToJsonEncodeArrayRector' => $baseDir . '/rules/CodingStyle/Rector/Assign/ManualJsonStringToJsonEncodeArrayRector.php', 'Rector\\CodingStyle\\Rector\\Assign\\PHPStormVarAnnotationRector' => $baseDir . '/rules/CodingStyle/Rector/Assign/PHPStormVarAnnotationRector.php', 'Rector\\CodingStyle\\Rector\\Assign\\SplitDoubleAssignRector' => $baseDir . '/rules/CodingStyle/Rector/Assign/SplitDoubleAssignRector.php', @@ -1459,7 +1456,6 @@ return array( 'Rector\\CodingStyle\\Rector\\String_\\UseClassKeywordForClassNameResolutionRector' => $baseDir . '/rules/CodingStyle/Rector/String_/UseClassKeywordForClassNameResolutionRector.php', 'Rector\\CodingStyle\\Rector\\Switch_\\BinarySwitchToIfElseRector' => $baseDir . '/rules/CodingStyle/Rector/Switch_/BinarySwitchToIfElseRector.php', 'Rector\\CodingStyle\\Rector\\Ternary\\TernaryConditionVariableAssignmentRector' => $baseDir . '/rules/CodingStyle/Rector/Ternary/TernaryConditionVariableAssignmentRector.php', - 'Rector\\CodingStyle\\Rector\\Use_\\RemoveUnusedAliasRector' => $baseDir . '/rules/CodingStyle/Rector/Use_/RemoveUnusedAliasRector.php', 'Rector\\CodingStyle\\Rector\\Use_\\SeparateMultiUseImportsRector' => $baseDir . '/rules/CodingStyle/Rector/Use_/SeparateMultiUseImportsRector.php', 'Rector\\CodingStyle\\Reflection\\VendorLocationDetector' => $baseDir . '/rules/CodingStyle/Reflection/VendorLocationDetector.php', 'Rector\\CodingStyle\\TypeAnalyzer\\IterableTypeAnalyzer' => $baseDir . '/rules/CodingStyle/TypeAnalyzer/IterableTypeAnalyzer.php', @@ -1590,7 +1586,6 @@ return array( 'Rector\\Core\\PhpParser\\ClassLikeAstResolver' => $baseDir . '/src/PhpParser/ClassLikeAstResolver.php', 'Rector\\Core\\PhpParser\\Comparing\\ConditionSearcher' => $baseDir . '/src/PhpParser/Comparing/ConditionSearcher.php', 'Rector\\Core\\PhpParser\\Comparing\\NodeComparator' => $baseDir . '/src/PhpParser/Comparing/NodeComparator.php', - 'Rector\\Core\\PhpParser\\NodeFinder\\FullyQualifiedFromUseFinder' => $baseDir . '/src/PhpParser/NodeFinder/FullyQualifiedFromUseFinder.php', 'Rector\\Core\\PhpParser\\NodeFinder\\LocalConstantFinder' => $baseDir . '/src/PhpParser/NodeFinder/LocalConstantFinder.php', 'Rector\\Core\\PhpParser\\NodeFinder\\LocalMethodCallFinder' => $baseDir . '/src/PhpParser/NodeFinder/LocalMethodCallFinder.php', 'Rector\\Core\\PhpParser\\NodeFinder\\PropertyFetchFinder' => $baseDir . '/src/PhpParser/NodeFinder/PropertyFetchFinder.php', @@ -1944,8 +1939,6 @@ return array( 'Rector\\MysqlToMysqli\\Rector\\FuncCall\\MysqlFuncCallToMysqliRector' => $baseDir . '/rules/MysqlToMysqli/Rector/FuncCall/MysqlFuncCallToMysqliRector.php', 'Rector\\MysqlToMysqli\\Rector\\FuncCall\\MysqlPConnectToMysqliConnectRector' => $baseDir . '/rules/MysqlToMysqli/Rector/FuncCall/MysqlPConnectToMysqliConnectRector.php', 'Rector\\MysqlToMysqli\\Rector\\FuncCall\\MysqlQueryMysqlErrorWithLinkRector' => $baseDir . '/rules/MysqlToMysqli/Rector/FuncCall/MysqlQueryMysqlErrorWithLinkRector.php', - 'Rector\\NameImporting\\NodeAnalyzer\\UseAnalyzer' => $baseDir . '/packages/NameImporting/NodeAnalyzer/UseAnalyzer.php', - 'Rector\\NameImporting\\ValueObject\\NameAndParent' => $baseDir . '/packages/NameImporting/ValueObject/NameAndParent.php', 'Rector\\Naming\\Contract\\Guard\\ConflictingNameGuardInterface' => $baseDir . '/rules/Naming/Contract/Guard/ConflictingNameGuardInterface.php', 'Rector\\Naming\\Contract\\RenameParamValueObjectInterface' => $baseDir . '/rules/Naming/Contract/RenameParamValueObjectInterface.php', 'Rector\\Naming\\Contract\\RenamePropertyValueObjectInterface' => $baseDir . '/rules/Naming/Contract/RenamePropertyValueObjectInterface.php', diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index ef1d5d2f639..d3e116b7886 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit7ca76728edb0a984003398e31dc50a90 +class ComposerAutoloaderInit1597e5290d82f782f1db9173ddac309a { private static $loader; @@ -22,15 +22,15 @@ class ComposerAutoloaderInit7ca76728edb0a984003398e31dc50a90 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit7ca76728edb0a984003398e31dc50a90', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit1597e5290d82f782f1db9173ddac309a', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); - spl_autoload_unregister(array('ComposerAutoloaderInit7ca76728edb0a984003398e31dc50a90', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit1597e5290d82f782f1db9173ddac309a', '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\ComposerStaticInit7ca76728edb0a984003398e31dc50a90::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit1597e5290d82f782f1db9173ddac309a::getInitializer($loader)); } else { $classMap = require __DIR__ . '/autoload_classmap.php'; if ($classMap) { @@ -42,19 +42,19 @@ class ComposerAutoloaderInit7ca76728edb0a984003398e31dc50a90 $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit7ca76728edb0a984003398e31dc50a90::$files; + $includeFiles = Composer\Autoload\ComposerStaticInit1597e5290d82f782f1db9173ddac309a::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire7ca76728edb0a984003398e31dc50a90($fileIdentifier, $file); + composerRequire1597e5290d82f782f1db9173ddac309a($fileIdentifier, $file); } return $loader; } } -function composerRequire7ca76728edb0a984003398e31dc50a90($fileIdentifier, $file) +function composerRequire1597e5290d82f782f1db9173ddac309a($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a5e65ae0423..689c06860ce 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit7ca76728edb0a984003398e31dc50a90 +class ComposerStaticInit1597e5290d82f782f1db9173ddac309a { public static $files = array ( 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', @@ -1740,7 +1740,6 @@ class ComposerStaticInit7ca76728edb0a984003398e31dc50a90 'Rector\\CodingStyle\\Contract\\ClassNameImport\\ClassNameImportSkipVoterInterface' => __DIR__ . '/../..' . '/rules/CodingStyle/Contract/ClassNameImport/ClassNameImportSkipVoterInterface.php', 'Rector\\CodingStyle\\Enum\\PreferenceSelfThis' => __DIR__ . '/../..' . '/rules/CodingStyle/Enum/PreferenceSelfThis.php', 'Rector\\CodingStyle\\Naming\\ClassNaming' => __DIR__ . '/../..' . '/rules/CodingStyle/Naming/ClassNaming.php', - 'Rector\\CodingStyle\\Naming\\NameRenamer' => __DIR__ . '/../..' . '/rules/CodingStyle/Naming/NameRenamer.php', 'Rector\\CodingStyle\\NodeAnalyzer\\ImplodeAnalyzer' => __DIR__ . '/../..' . '/rules/CodingStyle/NodeAnalyzer/ImplodeAnalyzer.php', 'Rector\\CodingStyle\\NodeAnalyzer\\SpreadVariablesCollector' => __DIR__ . '/../..' . '/rules/CodingStyle/NodeAnalyzer/SpreadVariablesCollector.php', 'Rector\\CodingStyle\\NodeAnalyzer\\UseImportNameMatcher' => __DIR__ . '/../..' . '/rules/CodingStyle/NodeAnalyzer/UseImportNameMatcher.php', @@ -1749,9 +1748,7 @@ class ComposerStaticInit7ca76728edb0a984003398e31dc50a90 'Rector\\CodingStyle\\NodeFactory\\JsonEncodeStaticCallFactory' => __DIR__ . '/../..' . '/rules/CodingStyle/NodeFactory/JsonEncodeStaticCallFactory.php', 'Rector\\CodingStyle\\Node\\ConcatJoiner' => __DIR__ . '/../..' . '/rules/CodingStyle/Node/ConcatJoiner.php', 'Rector\\CodingStyle\\Node\\ConcatManipulator' => __DIR__ . '/../..' . '/rules/CodingStyle/Node/ConcatManipulator.php', - 'Rector\\CodingStyle\\Node\\DocAliasResolver' => __DIR__ . '/../..' . '/rules/CodingStyle/Node/DocAliasResolver.php', 'Rector\\CodingStyle\\Node\\NameImporter' => __DIR__ . '/../..' . '/rules/CodingStyle/Node/NameImporter.php', - 'Rector\\CodingStyle\\Node\\UseNameAliasToNameResolver' => __DIR__ . '/../..' . '/rules/CodingStyle/Node/UseNameAliasToNameResolver.php', 'Rector\\CodingStyle\\Rector\\Assign\\ManualJsonStringToJsonEncodeArrayRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Assign/ManualJsonStringToJsonEncodeArrayRector.php', 'Rector\\CodingStyle\\Rector\\Assign\\PHPStormVarAnnotationRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Assign/PHPStormVarAnnotationRector.php', 'Rector\\CodingStyle\\Rector\\Assign\\SplitDoubleAssignRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Assign/SplitDoubleAssignRector.php', @@ -1789,7 +1786,6 @@ class ComposerStaticInit7ca76728edb0a984003398e31dc50a90 'Rector\\CodingStyle\\Rector\\String_\\UseClassKeywordForClassNameResolutionRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/String_/UseClassKeywordForClassNameResolutionRector.php', 'Rector\\CodingStyle\\Rector\\Switch_\\BinarySwitchToIfElseRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Switch_/BinarySwitchToIfElseRector.php', 'Rector\\CodingStyle\\Rector\\Ternary\\TernaryConditionVariableAssignmentRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Ternary/TernaryConditionVariableAssignmentRector.php', - 'Rector\\CodingStyle\\Rector\\Use_\\RemoveUnusedAliasRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Use_/RemoveUnusedAliasRector.php', 'Rector\\CodingStyle\\Rector\\Use_\\SeparateMultiUseImportsRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Use_/SeparateMultiUseImportsRector.php', 'Rector\\CodingStyle\\Reflection\\VendorLocationDetector' => __DIR__ . '/../..' . '/rules/CodingStyle/Reflection/VendorLocationDetector.php', 'Rector\\CodingStyle\\TypeAnalyzer\\IterableTypeAnalyzer' => __DIR__ . '/../..' . '/rules/CodingStyle/TypeAnalyzer/IterableTypeAnalyzer.php', @@ -1920,7 +1916,6 @@ class ComposerStaticInit7ca76728edb0a984003398e31dc50a90 'Rector\\Core\\PhpParser\\ClassLikeAstResolver' => __DIR__ . '/../..' . '/src/PhpParser/ClassLikeAstResolver.php', 'Rector\\Core\\PhpParser\\Comparing\\ConditionSearcher' => __DIR__ . '/../..' . '/src/PhpParser/Comparing/ConditionSearcher.php', 'Rector\\Core\\PhpParser\\Comparing\\NodeComparator' => __DIR__ . '/../..' . '/src/PhpParser/Comparing/NodeComparator.php', - 'Rector\\Core\\PhpParser\\NodeFinder\\FullyQualifiedFromUseFinder' => __DIR__ . '/../..' . '/src/PhpParser/NodeFinder/FullyQualifiedFromUseFinder.php', 'Rector\\Core\\PhpParser\\NodeFinder\\LocalConstantFinder' => __DIR__ . '/../..' . '/src/PhpParser/NodeFinder/LocalConstantFinder.php', 'Rector\\Core\\PhpParser\\NodeFinder\\LocalMethodCallFinder' => __DIR__ . '/../..' . '/src/PhpParser/NodeFinder/LocalMethodCallFinder.php', 'Rector\\Core\\PhpParser\\NodeFinder\\PropertyFetchFinder' => __DIR__ . '/../..' . '/src/PhpParser/NodeFinder/PropertyFetchFinder.php', @@ -2274,8 +2269,6 @@ class ComposerStaticInit7ca76728edb0a984003398e31dc50a90 'Rector\\MysqlToMysqli\\Rector\\FuncCall\\MysqlFuncCallToMysqliRector' => __DIR__ . '/../..' . '/rules/MysqlToMysqli/Rector/FuncCall/MysqlFuncCallToMysqliRector.php', 'Rector\\MysqlToMysqli\\Rector\\FuncCall\\MysqlPConnectToMysqliConnectRector' => __DIR__ . '/../..' . '/rules/MysqlToMysqli/Rector/FuncCall/MysqlPConnectToMysqliConnectRector.php', 'Rector\\MysqlToMysqli\\Rector\\FuncCall\\MysqlQueryMysqlErrorWithLinkRector' => __DIR__ . '/../..' . '/rules/MysqlToMysqli/Rector/FuncCall/MysqlQueryMysqlErrorWithLinkRector.php', - 'Rector\\NameImporting\\NodeAnalyzer\\UseAnalyzer' => __DIR__ . '/../..' . '/packages/NameImporting/NodeAnalyzer/UseAnalyzer.php', - 'Rector\\NameImporting\\ValueObject\\NameAndParent' => __DIR__ . '/../..' . '/packages/NameImporting/ValueObject/NameAndParent.php', 'Rector\\Naming\\Contract\\Guard\\ConflictingNameGuardInterface' => __DIR__ . '/../..' . '/rules/Naming/Contract/Guard/ConflictingNameGuardInterface.php', 'Rector\\Naming\\Contract\\RenameParamValueObjectInterface' => __DIR__ . '/../..' . '/rules/Naming/Contract/RenameParamValueObjectInterface.php', 'Rector\\Naming\\Contract\\RenamePropertyValueObjectInterface' => __DIR__ . '/../..' . '/rules/Naming/Contract/RenamePropertyValueObjectInterface.php', @@ -3529,9 +3522,9 @@ class ComposerStaticInit7ca76728edb0a984003398e31dc50a90 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit7ca76728edb0a984003398e31dc50a90::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit7ca76728edb0a984003398e31dc50a90::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit7ca76728edb0a984003398e31dc50a90::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit1597e5290d82f782f1db9173ddac309a::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit1597e5290d82f782f1db9173ddac309a::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit1597e5290d82f782f1db9173ddac309a::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/scoper-autoload.php b/vendor/scoper-autoload.php index 679b0df34c0..e3cb6739c0a 100644 --- a/vendor/scoper-autoload.php +++ b/vendor/scoper-autoload.php @@ -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('RectorPrefix20211105\AutoloadIncluder'); } -if (!class_exists('ComposerAutoloaderInit7ca76728edb0a984003398e31dc50a90', false) && !interface_exists('ComposerAutoloaderInit7ca76728edb0a984003398e31dc50a90', false) && !trait_exists('ComposerAutoloaderInit7ca76728edb0a984003398e31dc50a90', false)) { - spl_autoload_call('RectorPrefix20211105\ComposerAutoloaderInit7ca76728edb0a984003398e31dc50a90'); +if (!class_exists('ComposerAutoloaderInit1597e5290d82f782f1db9173ddac309a', false) && !interface_exists('ComposerAutoloaderInit1597e5290d82f782f1db9173ddac309a', false) && !trait_exists('ComposerAutoloaderInit1597e5290d82f782f1db9173ddac309a', false)) { + spl_autoload_call('RectorPrefix20211105\ComposerAutoloaderInit1597e5290d82f782f1db9173ddac309a'); } 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('RectorPrefix20211105\Helmich\TypoScriptParser\Parser\AST\Statement'); @@ -3306,9 +3306,9 @@ if (!function_exists('print_node')) { return \RectorPrefix20211105\print_node(...func_get_args()); } } -if (!function_exists('composerRequire7ca76728edb0a984003398e31dc50a90')) { - function composerRequire7ca76728edb0a984003398e31dc50a90() { - return \RectorPrefix20211105\composerRequire7ca76728edb0a984003398e31dc50a90(...func_get_args()); +if (!function_exists('composerRequire1597e5290d82f782f1db9173ddac309a')) { + function composerRequire1597e5290d82f782f1db9173ddac309a() { + return \RectorPrefix20211105\composerRequire1597e5290d82f782f1db9173ddac309a(...func_get_args()); } } if (!function_exists('parseArgs')) {