mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-03 18:00:50 +00:00
Updated Rector to commit 658e48f31fcb26a0e56740a49a994dbab3c1e6b5
658e48f31f
Handle ->getDefaultValueExpression() return null (#3446)
This commit is contained in:
parent
f2707dea96
commit
9d9213d70c
|
@ -1,4 +1,4 @@
|
|||
# 414 Rules Overview
|
||||
# 412 Rules Overview
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
|||
|
||||
- [Php82](#php82) (3)
|
||||
|
||||
- [Privatization](#privatization) (8)
|
||||
- [Privatization](#privatization) (7)
|
||||
|
||||
- [Removing](#removing) (5)
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
|||
|
||||
- [Strict](#strict) (5)
|
||||
|
||||
- [Transform](#transform) (35)
|
||||
- [Transform](#transform) (34)
|
||||
|
||||
- [TypeDeclaration](#typedeclaration) (36)
|
||||
|
||||
|
@ -6840,45 +6840,6 @@ Privatize getter of local property to property
|
|||
|
||||
<br>
|
||||
|
||||
### ReplaceStringWithClassConstantRector
|
||||
|
||||
Replace string values in specific method call by constant of provided class
|
||||
|
||||
:wrench: **configure it!**
|
||||
|
||||
- class: [`Rector\Privatization\Rector\MethodCall\ReplaceStringWithClassConstantRector`](../rules/Privatization/Rector/MethodCall/ReplaceStringWithClassConstantRector.php)
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Privatization\Rector\MethodCall\ReplaceStringWithClassConstantRector;
|
||||
use Rector\Privatization\ValueObject\ReplaceStringWithClassConstant;
|
||||
|
||||
return static function (RectorConfig $rectorConfig): void {
|
||||
$rectorConfig->ruleWithConfiguration(ReplaceStringWithClassConstantRector::class, [
|
||||
new ReplaceStringWithClassConstant('SomeClass', 'call', 0, 'Placeholder', false),
|
||||
]);
|
||||
};
|
||||
```
|
||||
|
||||
↓
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
- $this->call('name');
|
||||
+ $this->call(Placeholder::NAME);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## Removing
|
||||
|
||||
### ArgumentRemoverRector
|
||||
|
@ -7929,35 +7890,6 @@ return static function (RectorConfig $rectorConfig): void {
|
|||
|
||||
<br>
|
||||
|
||||
### ChangeSingletonToServiceRector
|
||||
|
||||
Change singleton class to normal class that can be registered as a service
|
||||
|
||||
- class: [`Rector\Transform\Rector\Class_\ChangeSingletonToServiceRector`](../rules/Transform/Rector/Class_/ChangeSingletonToServiceRector.php)
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
- private static $instance;
|
||||
-
|
||||
- private function __construct()
|
||||
+ public function __construct()
|
||||
{
|
||||
- }
|
||||
-
|
||||
- public static function getInstance()
|
||||
- {
|
||||
- if (null === static::$instance) {
|
||||
- static::$instance = new static();
|
||||
- }
|
||||
-
|
||||
- return static::$instance;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### DimFetchAssignToMethodCallRector
|
||||
|
||||
Change magic array access add to `$list[],` to explicit `$list->addMethod(...)`
|
||||
|
|
|
@ -165,7 +165,13 @@ final class ArrayTypeAnalyzer
|
|||
$phpPropertyReflection = $this->reflectionResolver->resolvePropertyReflectionFromPropertyFetch($expr);
|
||||
if ($phpPropertyReflection instanceof PhpPropertyReflection) {
|
||||
$reflectionProperty = $phpPropertyReflection->getNativeReflection();
|
||||
return \is_array($reflectionProperty->getDefaultValue());
|
||||
$betterReflection = $reflectionProperty->getBetterReflection();
|
||||
$defaultValueExpr = $betterReflection->getDefaultValueExpression();
|
||||
if (!$defaultValueExpr instanceof Expr) {
|
||||
return \false;
|
||||
}
|
||||
$defaultValueType = $this->nodeTypeResolver->getType($defaultValueExpr);
|
||||
return $defaultValueType->isArray()->yes();
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'c9a621de856eac0be037169c3c07c1b279b3cc9f';
|
||||
public const PACKAGE_VERSION = '658e48f31fcb26a0e56740a49a994dbab3c1e6b5';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-03-02 23:39:50';
|
||||
public const RELEASE_DATE = '2023-03-03 10:01:40';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit7066486d076958430468d361debe5921::getLoader();
|
||||
return ComposerAutoloaderInitae061628df81b43cbeda68c381086662::getLoader();
|
||||
|
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit7066486d076958430468d361debe5921
|
||||
class ComposerAutoloaderInitae061628df81b43cbeda68c381086662
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,17 +22,17 @@ class ComposerAutoloaderInit7066486d076958430468d361debe5921
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit7066486d076958430468d361debe5921', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitae061628df81b43cbeda68c381086662', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit7066486d076958430468d361debe5921', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitae061628df81b43cbeda68c381086662', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit7066486d076958430468d361debe5921::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitae061628df81b43cbeda68c381086662::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit7066486d076958430468d361debe5921::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitae061628df81b43cbeda68c381086662::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit7066486d076958430468d361debe5921
|
||||
class ComposerStaticInitae061628df81b43cbeda68c381086662
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
|
@ -3134,9 +3134,9 @@ class ComposerStaticInit7066486d076958430468d361debe5921
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit7066486d076958430468d361debe5921::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit7066486d076958430468d361debe5921::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit7066486d076958430468d361debe5921::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitae061628df81b43cbeda68c381086662::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitae061628df81b43cbeda68c381086662::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitae061628df81b43cbeda68c381086662::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
10
vendor/composer/installed.json
vendored
10
vendor/composer/installed.json
vendored
|
@ -1916,12 +1916,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
|
||||
"reference": "a8168bc365546a970190aa0e0709ab02c998e84c"
|
||||
"reference": "b610182bba8fd1a911a7a3a5367109737d90dd30"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/a8168bc365546a970190aa0e0709ab02c998e84c",
|
||||
"reference": "a8168bc365546a970190aa0e0709ab02c998e84c",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/b610182bba8fd1a911a7a3a5367109737d90dd30",
|
||||
"reference": "b610182bba8fd1a911a7a3a5367109737d90dd30",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1940,7 +1940,7 @@
|
|||
"rector\/phpstan-rules": "^0.6",
|
||||
"rector\/rector-debugging": "dev-main",
|
||||
"rector\/rector-generator": "^0.6.10",
|
||||
"rector\/rector-src": "dev-main",
|
||||
"rector\/rector-src": "dev-hanlde-default-value-expr-null",
|
||||
"symplify\/easy-ci": "^11.2",
|
||||
"symplify\/easy-coding-standard": "^11.2",
|
||||
"symplify\/phpstan-extensions": "^11.1",
|
||||
|
@ -1948,7 +1948,7 @@
|
|||
"symplify\/rule-doc-generator": "^11.1",
|
||||
"symplify\/vendor-patches": "^11.1"
|
||||
},
|
||||
"time": "2023-03-02T23:33:33+00:00",
|
||||
"time": "2023-03-03T09:54:32+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
|
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
|
@ -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 a8168bc'), '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 d4acd90'), '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 dfeb67c'), '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 3cebcd9'));
|
||||
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 b610182'), '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 d4acd90'), '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 dfeb67c'), '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 3cebcd9'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
|
2
vendor/rector/rector-doctrine/composer.json
vendored
2
vendor/rector/rector-doctrine/composer.json
vendored
|
@ -15,7 +15,7 @@
|
|||
"symplify\/phpstan-extensions": "^11.1",
|
||||
"symplify\/easy-coding-standard": "^11.2",
|
||||
"symplify\/rule-doc-generator": "^11.1",
|
||||
"rector\/rector-src": "dev-main",
|
||||
"rector\/rector-src": "dev-hanlde-default-value-expr-null",
|
||||
"doctrine\/orm": "^2.10",
|
||||
"phpstan\/phpstan-webmozart-assert": "^1.0",
|
||||
"phpstan\/phpstan-strict-rules": "^1.1",
|
||||
|
|
Loading…
Reference in New Issue
Block a user