Updated Rector to commit ef253094f0

ef253094f0 bump docs
This commit is contained in:
Tomas Votruba 2021-10-14 15:36:34 +00:00
parent 9e28d44a9b
commit f19d6bb9aa
6 changed files with 66 additions and 22 deletions

View File

@ -1,4 +1,4 @@
# 482 Rules Overview
# 483 Rules Overview
<br>
@ -94,7 +94,7 @@
- [Strict](#strict) (5)
- [Transform](#transform) (34)
- [Transform](#transform) (35)
- [TypeDeclaration](#typedeclaration) (20)
@ -1699,7 +1699,7 @@ Changes strlen comparison to 0 to direct empty string compare
```diff
class SomeClass
{
public function run($value)
public function run(string $value)
{
- $empty = strlen($value) === 0;
+ $empty = $value === '';
@ -10084,6 +10084,50 @@ return static function (ContainerConfigurator $containerConfigurator): void {
<br>
### AttributeKeyToClassConstFetchRector
Replace key value on specific attribute to class constant
:wrench: **configure it!**
- class: [`Rector\Transform\Rector\Attribute\AttributeKeyToClassConstFetchRector`](../rules/Transform/Rector/Attribute/AttributeKeyToClassConstFetchRector.php)
```php
use Rector\Transform\Rector\Attribute\AttributeKeyToClassConstFetchRector;
use Rector\Transform\ValueObject\AttributeKeyToClassConstFetch;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(AttributeKeyToClassConstFetchRector::class)
->call('configure', [[
AttributeKeyToClassConstFetchRector::ATTRIBUTE_KEYS_TO_CLASS_CONST_FETCHES => ValueObjectInliner::inline([
new AttributeKeyToClassConstFetch('Doctrine\ORM\Mapping\Column', 'type', 'Doctrine\DBAL\Types\Types', [
'STRING',
]), ]
),
]]);
};
```
```diff
use Doctrine\ORM\Mapping\Column;
+use Doctrine\DBAL\Types\Types;
class SomeClass
{
- #[Column(type: "string")]
+ #[Column(type: Types::STRING)]
public $name;
}
```
<br>
### CallableInMethodCallToVariableRector
Change a callable in method call to standalone variable assign

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '01cb29e5d431df6e3ec5674fdd09b0dc77c17c88';
public const PACKAGE_VERSION = 'ef253094f0ddcd7c2d9abe9dc3ea3e16c7611bd0';
/**
* @var string
*/
public const RELEASE_DATE = '2021-10-14 15:20:40';
public const RELEASE_DATE = '2021-10-14 17:21:39';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20211014\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit9540bb1ec762a7db726b19ccf1028683::getLoader();
return ComposerAutoloaderInit4436d0106163042ef7061b6317671435::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit9540bb1ec762a7db726b19ccf1028683
class ComposerAutoloaderInit4436d0106163042ef7061b6317671435
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit9540bb1ec762a7db726b19ccf1028683
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit9540bb1ec762a7db726b19ccf1028683', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit4436d0106163042ef7061b6317671435', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit9540bb1ec762a7db726b19ccf1028683', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit4436d0106163042ef7061b6317671435', '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\ComposerStaticInit9540bb1ec762a7db726b19ccf1028683::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit4436d0106163042ef7061b6317671435::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInit9540bb1ec762a7db726b19ccf1028683
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit9540bb1ec762a7db726b19ccf1028683::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit4436d0106163042ef7061b6317671435::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire9540bb1ec762a7db726b19ccf1028683($fileIdentifier, $file);
composerRequire4436d0106163042ef7061b6317671435($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire9540bb1ec762a7db726b19ccf1028683($fileIdentifier, $file)
function composerRequire4436d0106163042ef7061b6317671435($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit9540bb1ec762a7db726b19ccf1028683
class ComposerStaticInit4436d0106163042ef7061b6317671435
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3894,9 +3894,9 @@ class ComposerStaticInit9540bb1ec762a7db726b19ccf1028683
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit9540bb1ec762a7db726b19ccf1028683::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit9540bb1ec762a7db726b19ccf1028683::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit9540bb1ec762a7db726b19ccf1028683::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit4436d0106163042ef7061b6317671435::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit4436d0106163042ef7061b6317671435::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit4436d0106163042ef7061b6317671435::$classMap;
}, null, ClassLoader::class);
}

View File

@ -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('RectorPrefix20211014\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit9540bb1ec762a7db726b19ccf1028683', false) && !interface_exists('ComposerAutoloaderInit9540bb1ec762a7db726b19ccf1028683', false) && !trait_exists('ComposerAutoloaderInit9540bb1ec762a7db726b19ccf1028683', false)) {
spl_autoload_call('RectorPrefix20211014\ComposerAutoloaderInit9540bb1ec762a7db726b19ccf1028683');
if (!class_exists('ComposerAutoloaderInit4436d0106163042ef7061b6317671435', false) && !interface_exists('ComposerAutoloaderInit4436d0106163042ef7061b6317671435', false) && !trait_exists('ComposerAutoloaderInit4436d0106163042ef7061b6317671435', false)) {
spl_autoload_call('RectorPrefix20211014\ComposerAutoloaderInit4436d0106163042ef7061b6317671435');
}
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('RectorPrefix20211014\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -3306,9 +3306,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20211014\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire9540bb1ec762a7db726b19ccf1028683')) {
function composerRequire9540bb1ec762a7db726b19ccf1028683() {
return \RectorPrefix20211014\composerRequire9540bb1ec762a7db726b19ccf1028683(...func_get_args());
if (!function_exists('composerRequire4436d0106163042ef7061b6317671435')) {
function composerRequire4436d0106163042ef7061b6317671435() {
return \RectorPrefix20211014\composerRequire4436d0106163042ef7061b6317671435(...func_get_args());
}
}
if (!function_exists('parseArgs')) {