diff --git a/packages/FileSystemRector/ValueObject/AddedFileWithContent.php b/packages/FileSystemRector/ValueObject/AddedFileWithContent.php index beef8262055..9a2ba1e4bfe 100644 --- a/packages/FileSystemRector/ValueObject/AddedFileWithContent.php +++ b/packages/FileSystemRector/ValueObject/AddedFileWithContent.php @@ -27,11 +27,11 @@ final class AddedFileWithContent implements AddedFileInterface } public function getRealPath() : string { - $realpath = \realpath($this->filePath); - if ($realpath === \false) { + $realPath = \realpath($this->filePath); + if ($realPath === \false) { throw new ShouldNotHappenException(); } - return $realpath; + return $realPath; } public function getFilePath() : string { diff --git a/packages/StaticTypeMapper/Naming/NameScopeFactory.php b/packages/StaticTypeMapper/Naming/NameScopeFactory.php index 65fa646f760..4b62c4018f7 100644 --- a/packages/StaticTypeMapper/Naming/NameScopeFactory.php +++ b/packages/StaticTypeMapper/Naming/NameScopeFactory.php @@ -109,8 +109,7 @@ final class NameScopeFactory $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node); $templateTypes = []; foreach ($phpDocInfo->getTemplateTagValueNodes() as $templateTagValueNode) { - $phpstanType = $this->staticTypeMapper->mapPHPStanPhpDocTypeToPHPStanType($templateTagValueNode, $node); - $templateTypes[$templateTagValueNode->name] = $phpstanType; + $templateTypes[$templateTagValueNode->name] = $this->staticTypeMapper->mapPHPStanPhpDocTypeToPHPStanType($templateTagValueNode, $node); } return $templateTypes; } diff --git a/packages/Testing/TestingParser/TestingParser.php b/packages/Testing/TestingParser/TestingParser.php index 0240ccb6ee3..e874e578e7b 100644 --- a/packages/Testing/TestingParser/TestingParser.php +++ b/packages/Testing/TestingParser/TestingParser.php @@ -47,12 +47,12 @@ final class TestingParser /** * @return Node[] */ - public function parseFileToDecoratedNodes(string $filepath) : array + public function parseFileToDecoratedNodes(string $filePath) : array { // autoload file - require_once $filepath; - $smartFileInfo = new SmartFileInfo($filepath); - $this->parameterProvider->changeParameter(Option::SOURCE, [$filepath]); + require_once $filePath; + $smartFileInfo = new SmartFileInfo($filePath); + $this->parameterProvider->changeParameter(Option::SOURCE, [$filePath]); $nodes = $this->rectorParser->parseFile($smartFileInfo); $file = new File($smartFileInfo, $smartFileInfo->getContents()); return $this->nodeScopeAndMetadataDecorator->decorateNodesFromFile($file, $nodes); diff --git a/rules/DeadCode/Rector/BinaryOp/RemoveDuplicatedInstanceOfRector.php b/rules/DeadCode/Rector/BinaryOp/RemoveDuplicatedInstanceOfRector.php index 888364e72c6..ee81f1cab93 100644 --- a/rules/DeadCode/Rector/BinaryOp/RemoveDuplicatedInstanceOfRector.php +++ b/rules/DeadCode/Rector/BinaryOp/RemoveDuplicatedInstanceOfRector.php @@ -83,14 +83,14 @@ CODE_SAMPLE return $parentNode instanceof BinaryOp; }); $uniqueInstanceOfKeys = []; - foreach ($instanceOfs as $instanceOf) { - $uniqueKey = $this->instanceOfUniqueKeyResolver->resolve($instanceOf); + foreach ($instanceOfs as $instanceof) { + $uniqueKey = $this->instanceOfUniqueKeyResolver->resolve($instanceof); if ($uniqueKey === null) { continue; } // already present before → duplicated if (\in_array($uniqueKey, $uniqueInstanceOfKeys, \true)) { - $duplicatedInstanceOfs[] = $instanceOf; + $duplicatedInstanceOfs[] = $instanceof; } $uniqueInstanceOfKeys[] = $uniqueKey; } diff --git a/rules/DeadCode/Rector/If_/RemoveDeadInstanceOfRector.php b/rules/DeadCode/Rector/If_/RemoveDeadInstanceOfRector.php index 72446076e6e..b1e5f75f840 100644 --- a/rules/DeadCode/Rector/If_/RemoveDeadInstanceOfRector.php +++ b/rules/DeadCode/Rector/If_/RemoveDeadInstanceOfRector.php @@ -154,10 +154,10 @@ CODE_SAMPLE return \false; } $variable = $instanceof->expr; - $isReassign = (bool) $this->betterNodeFinder->findFirstPrevious($instanceof, function (Node $subNode) use($variable) : bool { + $isReAssign = (bool) $this->betterNodeFinder->findFirstPrevious($instanceof, function (Node $subNode) use($variable) : bool { return $subNode instanceof Assign && $this->nodeComparator->areNodesEqual($subNode->var, $variable); }); - if ($isReassign) { + if ($isReAssign) { return \false; } $params = $functionLike->getParams(); diff --git a/rules/EarlyReturn/Rector/Return_/ReturnBinaryOrToEarlyReturnRector.php b/rules/EarlyReturn/Rector/Return_/ReturnBinaryOrToEarlyReturnRector.php index 3f41ea883bf..16634660ae9 100644 --- a/rules/EarlyReturn/Rector/Return_/ReturnBinaryOrToEarlyReturnRector.php +++ b/rules/EarlyReturn/Rector/Return_/ReturnBinaryOrToEarlyReturnRector.php @@ -121,9 +121,9 @@ CODE_SAMPLE * @param If_[] $ifs * @return If_[] */ - private function collectLeftBooleanOrToIfs(BooleanOr $BooleanOr, Return_ $return, array $ifs) : array + private function collectLeftBooleanOrToIfs(BooleanOr $booleanOr, Return_ $return, array $ifs) : array { - $left = $BooleanOr->left; + $left = $booleanOr->left; if (!$left instanceof BooleanOr) { return [$this->ifManipulator->createIfStmt($left, new Return_($this->nodeFactory->createTrue()))]; } diff --git a/rules/Strict/NodeFactory/ExactCompareFactory.php b/rules/Strict/NodeFactory/ExactCompareFactory.php index 14b282b0946..96153b9f701 100644 --- a/rules/Strict/NodeFactory/ExactCompareFactory.php +++ b/rules/Strict/NodeFactory/ExactCompareFactory.php @@ -160,8 +160,7 @@ final class ExactCompareFactory return new Identical($expr, $this->nodeFactory->createTrue()); } if ($unionType instanceof TypeWithClassName) { - $instanceOf = new Instanceof_($expr, new FullyQualified($unionType->getClassName())); - return new BooleanNot($instanceOf); + return new BooleanNot(new Instanceof_($expr, new FullyQualified($unionType->getClassName()))); } $toNullIdentical = new Identical($expr, $this->nodeFactory->createNull()); if ($treatAsNonEmpty) { diff --git a/src/Application/ApplicationFileProcessor.php b/src/Application/ApplicationFileProcessor.php index d57a5d2d46e..dbe9c60dcf8 100644 --- a/src/Application/ApplicationFileProcessor.php +++ b/src/Application/ApplicationFileProcessor.php @@ -283,9 +283,9 @@ final class ApplicationFileProcessor $filePaths = []; foreach ($files as $file) { $smartFileInfo = $file->getSmartFileInfo(); - $pathName = $smartFileInfo->getPathname(); - if (\substr_compare($pathName, '.php', -\strlen('.php')) === 0) { - $filePaths[] = $pathName; + $pathname = $smartFileInfo->getPathname(); + if (\substr_compare($pathname, '.php', -\strlen('.php')) === 0) { + $filePaths[] = $pathname; } } return $filePaths; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index c4fad821c69..b01167f0a21 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -17,12 +17,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '9cb0a5efb59c51c662a4b6eb56753b9cc2174e21'; + public const PACKAGE_VERSION = 'ae31fb60aeb3c49fb47b3fa12c792098e67831c5'; /** * @api * @var string */ - public const RELEASE_DATE = '2022-07-20 06:55:29'; + public const RELEASE_DATE = '2022-07-20 05:00:57'; /** * @var int */ diff --git a/src/FileSystem/PhpFilesFinder.php b/src/FileSystem/PhpFilesFinder.php index dfd73a07b03..082e4e2498b 100644 --- a/src/FileSystem/PhpFilesFinder.php +++ b/src/FileSystem/PhpFilesFinder.php @@ -34,24 +34,24 @@ final class PhpFilesFinder $suffixRegexPattern = StaticNonPhpFileSuffixes::getSuffixRegexPattern(); // filter out non-PHP files foreach ($phpFileInfos as $key => $phpFileInfo) { - $pathName = $phpFileInfo->getPathname(); + $pathname = $phpFileInfo->getPathname(); /** * check .blade.php early so next .php check in next if can be skipped */ - if (\substr_compare($pathName, '.blade.php', -\strlen('.blade.php')) === 0) { + if (\substr_compare($pathname, '.blade.php', -\strlen('.blade.php')) === 0) { unset($phpFileInfos[$key]); continue; } /** * obvious */ - if (\substr_compare($pathName, '.php', -\strlen('.php')) === 0) { + if (\substr_compare($pathname, '.php', -\strlen('.php')) === 0) { continue; } /** * only check with regex when needed */ - if (StringUtils::isMatch($pathName, $suffixRegexPattern)) { + if (StringUtils::isMatch($pathname, $suffixRegexPattern)) { unset($phpFileInfos[$key]); } } diff --git a/src/NodeAnalyzer/TerminatedNodeAnalyzer.php b/src/NodeAnalyzer/TerminatedNodeAnalyzer.php index 01f372a96ca..236d4ae308c 100644 --- a/src/NodeAnalyzer/TerminatedNodeAnalyzer.php +++ b/src/NodeAnalyzer/TerminatedNodeAnalyzer.php @@ -106,8 +106,8 @@ final class TerminatedNodeAnalyzer if ($if->elseifs === [] && !$if->else instanceof Else_) { return \false; } - foreach ($if->elseifs as $elseIf) { - if (!$this->isTerminatedInLastStmts($elseIf->stmts, $stmt)) { + foreach ($if->elseifs as $elseif) { + if (!$this->isTerminatedInLastStmts($elseif->stmts, $stmt)) { return \false; } } diff --git a/vendor/autoload.php b/vendor/autoload.php index 76dfc5fd211..00f1d0773e4 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit8e6da83dabd79e423bc3c7245685560a::getLoader(); +return ComposerAutoloaderInitc9106d84b938caf4adb82321268441e1::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 7d8024071a1..e9523abdc47 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit8e6da83dabd79e423bc3c7245685560a +class ComposerAutoloaderInitc9106d84b938caf4adb82321268441e1 { private static $loader; @@ -22,19 +22,19 @@ class ComposerAutoloaderInit8e6da83dabd79e423bc3c7245685560a return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit8e6da83dabd79e423bc3c7245685560a', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitc9106d84b938caf4adb82321268441e1', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit8e6da83dabd79e423bc3c7245685560a', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitc9106d84b938caf4adb82321268441e1', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit8e6da83dabd79e423bc3c7245685560a::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitc9106d84b938caf4adb82321268441e1::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInit8e6da83dabd79e423bc3c7245685560a::$files; + $includeFiles = \Composer\Autoload\ComposerStaticInitc9106d84b938caf4adb82321268441e1::$files; foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire8e6da83dabd79e423bc3c7245685560a($fileIdentifier, $file); + composerRequirec9106d84b938caf4adb82321268441e1($fileIdentifier, $file); } return $loader; @@ -46,7 +46,7 @@ class ComposerAutoloaderInit8e6da83dabd79e423bc3c7245685560a * @param string $file * @return void */ -function composerRequire8e6da83dabd79e423bc3c7245685560a($fileIdentifier, $file) +function composerRequirec9106d84b938caf4adb82321268441e1($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index ff1ccb863c1..b7a75928d57 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit8e6da83dabd79e423bc3c7245685560a +class ComposerStaticInitc9106d84b938caf4adb82321268441e1 { public static $files = array ( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', @@ -3402,9 +3402,9 @@ class ComposerStaticInit8e6da83dabd79e423bc3c7245685560a public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit8e6da83dabd79e423bc3c7245685560a::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit8e6da83dabd79e423bc3c7245685560a::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit8e6da83dabd79e423bc3c7245685560a::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitc9106d84b938caf4adb82321268441e1::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitc9106d84b938caf4adb82321268441e1::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitc9106d84b938caf4adb82321268441e1::$classMap; }, null, ClassLoader::class); }