From 712ba426cbdd5aa8f582bc2f7382beeb621bde41 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 5 Jul 2021 23:20:51 +0000 Subject: [PATCH] Updated Rector to commit c002efe1d9c1fe206c03f745047e6ce6248e1b83 https://github.com/rectorphp/rector-src/commit/c002efe1d9c1fe206c03f745047e6ce6248e1b83 skip self type --- e2e/dont-execute-code/src/OutputInterface.php | 2 +- .../Contract/NodeNameResolverInterface.php | 5 +-- .../DowngradeParameterTypeWideningRector.php | 4 ++ src/Application/VersionResolver.php | 4 +- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 14 +++---- vendor/composer/autoload_static.php | 8 ++-- vendor/phpstan/phpdoc-parser/src/Ast/Node.php | 9 ++--- vendor/scoper-autoload.php | 10 ++--- .../symfony/console/Style/StyleInterface.php | 39 ++++++------------- .../Contract/PhpDocNodeVisitorInterface.php | 18 ++------- 11 files changed, 43 insertions(+), 72 deletions(-) diff --git a/e2e/dont-execute-code/src/OutputInterface.php b/e2e/dont-execute-code/src/OutputInterface.php index 35e75695a4e..fbe1a1a9ed1 100644 --- a/e2e/dont-execute-code/src/OutputInterface.php +++ b/e2e/dont-execute-code/src/OutputInterface.php @@ -3,7 +3,7 @@ declare(strict_types=1); -final class OutputInterface +final class OutputStyleOutputInterface { } diff --git a/packages/NodeNameResolver/Contract/NodeNameResolverInterface.php b/packages/NodeNameResolver/Contract/NodeNameResolverInterface.php index cf150c4a5cf..057d3814d17 100644 --- a/packages/NodeNameResolver/Contract/NodeNameResolverInterface.php +++ b/packages/NodeNameResolver/Contract/NodeNameResolverInterface.php @@ -10,8 +10,5 @@ interface NodeNameResolverInterface * @return class-string */ public function getNode() : string; - /** - * @param \PhpParser\Node $node - */ - public function resolve($node) : ?string; + public function resolve(\PhpParser\Node $node) : ?string; } diff --git a/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php b/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php index c951548f347..3d6b56e13c3 100644 --- a/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php +++ b/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php @@ -104,6 +104,10 @@ CODE_SAMPLE if ($classReflection->isSubclassOf($safeType)) { return null; } + // skip self too + if ($classReflection->getName() === $safeType) { + return null; + } } if ($node->isPrivate()) { return null; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 22884b4b558..acf76024ef2 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -16,11 +16,11 @@ final class VersionResolver /** * @var string */ - public const PACKAGE_VERSION = '97ca45aadeb4d05cb23101b0f7b12f6a7befe97c'; + public const PACKAGE_VERSION = 'c002efe1d9c1fe206c03f745047e6ce6248e1b83'; /** * @var string */ - public const RELEASE_DATE = '2021-07-06 00:57:20'; + public const RELEASE_DATE = '2021-07-06 01:10:55'; public static function resolvePackageVersion() : string { $process = new \RectorPrefix20210705\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__); diff --git a/vendor/autoload.php b/vendor/autoload.php index 87d1d39d028..d148f822c99 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitdb62b621edd5783626e68c5fb2f60b44::getLoader(); +return ComposerAutoloaderInit348820afafd364f12d71d311924b5491::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index ecdcaf801bd..5ce14845d9d 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitdb62b621edd5783626e68c5fb2f60b44 +class ComposerAutoloaderInit348820afafd364f12d71d311924b5491 { private static $loader; @@ -22,15 +22,15 @@ class ComposerAutoloaderInitdb62b621edd5783626e68c5fb2f60b44 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitdb62b621edd5783626e68c5fb2f60b44', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit348820afafd364f12d71d311924b5491', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); - spl_autoload_unregister(array('ComposerAutoloaderInitdb62b621edd5783626e68c5fb2f60b44', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit348820afafd364f12d71d311924b5491', '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\ComposerStaticInitdb62b621edd5783626e68c5fb2f60b44::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit348820afafd364f12d71d311924b5491::getInitializer($loader)); } else { $classMap = require __DIR__ . '/autoload_classmap.php'; if ($classMap) { @@ -42,19 +42,19 @@ class ComposerAutoloaderInitdb62b621edd5783626e68c5fb2f60b44 $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInitdb62b621edd5783626e68c5fb2f60b44::$files; + $includeFiles = Composer\Autoload\ComposerStaticInit348820afafd364f12d71d311924b5491::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequiredb62b621edd5783626e68c5fb2f60b44($fileIdentifier, $file); + composerRequire348820afafd364f12d71d311924b5491($fileIdentifier, $file); } return $loader; } } -function composerRequiredb62b621edd5783626e68c5fb2f60b44($fileIdentifier, $file) +function composerRequire348820afafd364f12d71d311924b5491($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 7a96dcae7d8..d2dad75312b 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitdb62b621edd5783626e68c5fb2f60b44 +class ComposerStaticInit348820afafd364f12d71d311924b5491 { public static $files = array ( 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', @@ -3866,9 +3866,9 @@ class ComposerStaticInitdb62b621edd5783626e68c5fb2f60b44 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitdb62b621edd5783626e68c5fb2f60b44::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitdb62b621edd5783626e68c5fb2f60b44::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitdb62b621edd5783626e68c5fb2f60b44::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit348820afafd364f12d71d311924b5491::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit348820afafd364f12d71d311924b5491::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit348820afafd364f12d71d311924b5491::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Node.php b/vendor/phpstan/phpdoc-parser/src/Ast/Node.php index 09a873f4c98..2efaf819d93 100644 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Node.php +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Node.php @@ -10,14 +10,11 @@ interface Node * @param string $key * @param mixed $value */ - public function setAttribute($key, $value) : void; - /** - * @param string $key - */ - public function hasAttribute($key) : bool; + public function setAttribute(string $key, $value) : void; + public function hasAttribute(string $key) : bool; /** * @param string $key * @return mixed */ - public function getAttribute($key); + public function getAttribute(string $key); } diff --git a/vendor/scoper-autoload.php b/vendor/scoper-autoload.php index ac5cf76d3c9..26200377aa8 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('RectorPrefix20210705\AutoloadIncluder'); } -if (!class_exists('ComposerAutoloaderInitdb62b621edd5783626e68c5fb2f60b44', false) && !interface_exists('ComposerAutoloaderInitdb62b621edd5783626e68c5fb2f60b44', false) && !trait_exists('ComposerAutoloaderInitdb62b621edd5783626e68c5fb2f60b44', false)) { - spl_autoload_call('RectorPrefix20210705\ComposerAutoloaderInitdb62b621edd5783626e68c5fb2f60b44'); +if (!class_exists('ComposerAutoloaderInit348820afafd364f12d71d311924b5491', false) && !interface_exists('ComposerAutoloaderInit348820afafd364f12d71d311924b5491', false) && !trait_exists('ComposerAutoloaderInit348820afafd364f12d71d311924b5491', false)) { + spl_autoload_call('RectorPrefix20210705\ComposerAutoloaderInit348820afafd364f12d71d311924b5491'); } if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) { spl_autoload_call('RectorPrefix20210705\Doctrine\Inflector\Inflector'); @@ -3308,9 +3308,9 @@ if (!function_exists('print_node')) { return \RectorPrefix20210705\print_node(...func_get_args()); } } -if (!function_exists('composerRequiredb62b621edd5783626e68c5fb2f60b44')) { - function composerRequiredb62b621edd5783626e68c5fb2f60b44() { - return \RectorPrefix20210705\composerRequiredb62b621edd5783626e68c5fb2f60b44(...func_get_args()); +if (!function_exists('composerRequire348820afafd364f12d71d311924b5491')) { + function composerRequire348820afafd364f12d71d311924b5491() { + return \RectorPrefix20210705\composerRequire348820afafd364f12d71d311924b5491(...func_get_args()); } } if (!function_exists('parseArgs')) { diff --git a/vendor/symfony/console/Style/StyleInterface.php b/vendor/symfony/console/Style/StyleInterface.php index 731143a12c0..0ac47b70209 100644 --- a/vendor/symfony/console/Style/StyleInterface.php +++ b/vendor/symfony/console/Style/StyleInterface.php @@ -19,19 +19,16 @@ interface StyleInterface { /** * Formats a command title. - * @param string $message */ - public function title($message); + public function title(string $message); /** * Formats a section title. - * @param string $message */ - public function section($message); + public function section(string $message); /** * Formats a list. - * @param mixed[] $elements */ - public function listing($elements); + public function listing(array $elements); /** * Formats informational text. * @@ -70,60 +67,46 @@ interface StyleInterface public function caution($message); /** * Formats a table. - * @param mixed[] $headers - * @param mixed[] $rows */ - public function table($headers, $rows); + public function table(array $headers, array $rows); /** * Asks a question. * * @return mixed - * @param string $question - * @param string|null $default - * @param callable|null $validator */ - public function ask($question, $default = null, $validator = null); + public function ask(string $question, string $default = null, callable $validator = null); /** * Asks a question with the user input hidden. * * @return mixed - * @param string $question - * @param callable|null $validator */ - public function askHidden($question, $validator = null); + public function askHidden(string $question, callable $validator = null); /** * Asks for confirmation. * * @return bool - * @param string $question - * @param bool $default */ - public function confirm($question, $default = \true); + public function confirm(string $question, bool $default = \true); /** * Asks a choice question. * * @param string|int|null $default * * @return mixed - * @param string $question - * @param mixed[] $choices */ - public function choice($question, $choices, $default = null); + public function choice(string $question, array $choices, $default = null); /** * Add newline(s). - * @param int $count */ - public function newLine($count = 1); + public function newLine(int $count = 1); /** * Starts the progress output. - * @param int $max */ - public function progressStart($max = 0); + public function progressStart(int $max = 0); /** * Advances the progress output X steps. - * @param int $step */ - public function progressAdvance($step = 1); + public function progressAdvance(int $step = 1); /** * Finishes the progress output. */ diff --git a/vendor/symplify/simple-php-doc-parser/src/Contract/PhpDocNodeVisitorInterface.php b/vendor/symplify/simple-php-doc-parser/src/Contract/PhpDocNodeVisitorInterface.php index 13ceb64eb73..73f8507d2c4 100644 --- a/vendor/symplify/simple-php-doc-parser/src/Contract/PhpDocNodeVisitorInterface.php +++ b/vendor/symplify/simple-php-doc-parser/src/Contract/PhpDocNodeVisitorInterface.php @@ -9,21 +9,11 @@ use PHPStan\PhpDocParser\Ast\Node; */ interface PhpDocNodeVisitorInterface { - /** - * @param \PHPStan\PhpDocParser\Ast\Node $node - */ - public function beforeTraverse($node) : void; + public function beforeTraverse(\PHPStan\PhpDocParser\Ast\Node $node) : void; /** * @return int|Node|null - * @param \PHPStan\PhpDocParser\Ast\Node $node */ - public function enterNode($node); - /** - * @param \PHPStan\PhpDocParser\Ast\Node $node - */ - public function leaveNode($node) : void; - /** - * @param \PHPStan\PhpDocParser\Ast\Node $node - */ - public function afterTraverse($node) : void; + public function enterNode(\PHPStan\PhpDocParser\Ast\Node $node); + public function leaveNode(\PHPStan\PhpDocParser\Ast\Node $node) : void; + public function afterTraverse(\PHPStan\PhpDocParser\Ast\Node $node) : void; }