Rector 0.15.10

This commit is contained in:
Tomas Votruba 2023-01-21 14:30:16 +00:00
parent 39a38b4fc5
commit 000bfb6f79
26 changed files with 47 additions and 17 deletions

View File

@ -19,7 +19,7 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '0.15.9';
public const PACKAGE_VERSION = '0.15.10';
/**
* @api
* @var string

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit8c2c957765ed34d4e254ccb1d98dbbcc::getLoader();
return ComposerAutoloaderInit7e658fbe9fcecca748641e9505f9eb08::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit8c2c957765ed34d4e254ccb1d98dbbcc
class ComposerAutoloaderInit7e658fbe9fcecca748641e9505f9eb08
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit8c2c957765ed34d4e254ccb1d98dbbcc
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit8c2c957765ed34d4e254ccb1d98dbbcc', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit7e658fbe9fcecca748641e9505f9eb08', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit8c2c957765ed34d4e254ccb1d98dbbcc', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit7e658fbe9fcecca748641e9505f9eb08', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit8c2c957765ed34d4e254ccb1d98dbbcc::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit7e658fbe9fcecca748641e9505f9eb08::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit8c2c957765ed34d4e254ccb1d98dbbcc::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit7e658fbe9fcecca748641e9505f9eb08::$files;
$requireFile = static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit8c2c957765ed34d4e254ccb1d98dbbcc
class ComposerStaticInit7e658fbe9fcecca748641e9505f9eb08
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3070,9 +3070,9 @@ class ComposerStaticInit8c2c957765ed34d4e254ccb1d98dbbcc
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit8c2c957765ed34d4e254ccb1d98dbbcc::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit8c2c957765ed34d4e254ccb1d98dbbcc::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit8c2c957765ed34d4e254ccb1d98dbbcc::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit7e658fbe9fcecca748641e9505f9eb08::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit7e658fbe9fcecca748641e9505f9eb08::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit7e658fbe9fcecca748641e9505f9eb08::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1914,12 +1914,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
"reference": "0c14a4252f0e16c5edd1428ae59d873fd430d605"
"reference": "cda9d4d04cf31f229fdcb96e63573957d7612f3e"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/0c14a4252f0e16c5edd1428ae59d873fd430d605",
"reference": "0c14a4252f0e16c5edd1428ae59d873fd430d605",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/cda9d4d04cf31f229fdcb96e63573957d7612f3e",
"reference": "cda9d4d04cf31f229fdcb96e63573957d7612f3e",
"shasum": ""
},
"require": {
@ -1948,7 +1948,7 @@
"tomasvotruba\/type-coverage": "^0.0.9",
"tomasvotruba\/unused-public": "^0.0.34"
},
"time": "2023-01-21T14:12:03+00:00",
"time": "2023-01-21T14:25:10+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -19,6 +19,7 @@ class Mapper extends \IteratorIterator
parent::__construct($iterator);
$this->callback = $callback;
}
#[\ReturnTypeWillChange]
public function current()
{
return ($this->callback)(parent::current(), parent::key());

View File

@ -60,6 +60,7 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator
* @param string|int $key
* @return T
*/
#[\ReturnTypeWillChange]
public function offsetGet($key)
{
return $this->{$key};

View File

@ -68,6 +68,7 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate
* @return T
* @throws Nette\OutOfRangeException
*/
#[\ReturnTypeWillChange]
public function offsetGet($index)
{
if (!\is_int($index) || $index < 0 || $index >= \count($this->list)) {

View File

@ -66,6 +66,7 @@ class DateTime extends \DateTime implements \JsonSerializable
* @param string|\DateTimeZone $timezone (default timezone is used if null is passed)
* @return static|false
*/
#[\ReturnTypeWillChange]
public static function createFromFormat($format, $time, $timezone = null)
{
if ($timezone === null) {

View File

@ -577,6 +577,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab
* @param int $index
* @return HtmlStringable|string
*/
#[\ReturnTypeWillChange]
public final function offsetGet($index)
{
return $this->children[$index];

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main f0c3c11'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 0c14a42'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9ea5f62'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 2cfc0a5'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 65d1307'));
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main f0c3c11'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main cda9d4d'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9ea5f62'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 2cfc0a5'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 65d1307'));
private function __construct()
{
}

View File

@ -27,6 +27,10 @@ use RectorPrefix202301\Webmozart\Assert\Assert;
*/
final class DowngradeAttributeToAnnotationRector extends AbstractRector implements ConfigurableRectorInterface
{
/**
* @var string[]
*/
private const SKIPPED_ATTRIBUTES = ['Attribute', 'ReturnTypeWillChange'];
/**
* @var DowngradeAttributeToAnnotation[]
*/
@ -88,6 +92,9 @@ CODE_SAMPLE
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node);
foreach ($node->attrGroups as $attrGroup) {
foreach ($attrGroup->attrs as $key => $attribute) {
if ($this->shouldSkipAttribute($attribute)) {
continue;
}
$attributeToAnnotation = $this->matchAttributeToAnnotation($attribute, $this->attributesToAnnotations);
if (!$attributeToAnnotation instanceof DowngradeAttributeToAnnotation) {
// clear the attribute to avoid inlining to a comment that will ignore the rest of the line
@ -145,4 +152,9 @@ CODE_SAMPLE
}
return null;
}
private function shouldSkipAttribute(Attribute $attribute) : bool
{
$attributeName = $attribute->name->toString();
return \in_array($attributeName, self::SKIPPED_ATTRIBUTES, \true);
}
}

View File

@ -13,6 +13,7 @@ namespace RectorPrefix202301\Symfony\Component\Console\Attribute;
/**
* Service tag to autoconfigure commands.
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
class AsCommand
{
/**

View File

@ -18,6 +18,7 @@ namespace RectorPrefix202301\Symfony\Contracts\Service\Attribute;
*
* @author Alexander M. Turek <me@derrabus.de>
*/
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)]
final class Required
{
}

View File

@ -22,6 +22,7 @@ use RectorPrefix202301\Symfony\Contracts\Service\ServiceSubscriberTrait;
*
* @author Kevin Bond <kevinbond@gmail.com>
*/
#[\Attribute(\Attribute::TARGET_METHOD)]
final class SubscribedService
{
/** @var object[] */

View File

@ -11,6 +11,7 @@
namespace RectorPrefix202301\Symfony\Component\DependencyInjection\Attribute;
use RectorPrefix202301\Symfony\Component\DependencyInjection\ContainerInterface;
#[\Attribute(\Attribute::TARGET_CLASS)]
class AsDecorator
{
/**

View File

@ -15,6 +15,7 @@ namespace RectorPrefix202301\Symfony\Component\DependencyInjection\Attribute;
*
* @author Nicolas Grekas <p@tchwork.com>
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
class AsTaggedItem
{
/**

View File

@ -15,6 +15,7 @@ namespace RectorPrefix202301\Symfony\Component\DependencyInjection\Attribute;
*
* @author Nicolas Grekas <p@tchwork.com>
*/
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class Autoconfigure
{
/**

View File

@ -15,6 +15,7 @@ namespace RectorPrefix202301\Symfony\Component\DependencyInjection\Attribute;
*
* @author Nicolas Grekas <p@tchwork.com>
*/
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class AutoconfigureTag extends Autoconfigure
{
public function __construct(string $name = null, array $attributes = [])

View File

@ -18,6 +18,7 @@ use RectorPrefix202301\Symfony\Component\ExpressionLanguage\Expression;
*
* @author Kevin Bond <kevinbond@gmail.com>
*/
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class Autowire
{
/**

View File

@ -10,6 +10,7 @@
*/
namespace RectorPrefix202301\Symfony\Component\DependencyInjection\Attribute;
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class MapDecorated
{
}

View File

@ -10,6 +10,7 @@
*/
namespace RectorPrefix202301\Symfony\Component\DependencyInjection\Attribute;
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class TaggedIterator
{
/**

View File

@ -10,6 +10,7 @@
*/
namespace RectorPrefix202301\Symfony\Component\DependencyInjection\Attribute;
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class TaggedLocator
{
/**

View File

@ -16,6 +16,7 @@ use RectorPrefix202301\Symfony\Component\DependencyInjection\Exception\InvalidAr
*
* @author Nicolas Grekas <p@tchwork.com>
*/
#[\Attribute(\Attribute::TARGET_PARAMETER)]
final class Target
{
/**

View File

@ -15,6 +15,7 @@ namespace RectorPrefix202301\Symfony\Component\DependencyInjection\Attribute;
*
* @author Nicolas Grekas <p@tchwork.com>
*/
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION | \Attribute::IS_REPEATABLE)]
class When
{
/**