mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 20:39:43 +01:00
Updated Rector to commit 61016bf5307b804df5babb81db27cacbccb12efa
61016bf530
[CodeQuality] Use existing PhpAttributeAnalyzer service instead of AttributeFinder from Doctrine package on DynamicDocBlockPropertyToNativePropertyRector (#6382)
This commit is contained in:
parent
1a957f8b19
commit
adf15bb534
1
vendor/composer/autoload_classmap.php
vendored
1
vendor/composer/autoload_classmap.php
vendored
@ -460,6 +460,7 @@ return array(
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\DB' => $vendorDir . '/illuminate/container/Attributes/DB.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\Database' => $vendorDir . '/illuminate/container/Attributes/Database.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\Log' => $vendorDir . '/illuminate/container/Attributes/Log.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\RouteParameter' => $vendorDir . '/illuminate/container/Attributes/RouteParameter.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\Storage' => $vendorDir . '/illuminate/container/Attributes/Storage.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\Tag' => $vendorDir . '/illuminate/container/Attributes/Tag.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\BoundMethod' => $vendorDir . '/illuminate/container/BoundMethod.php',
|
||||
|
1
vendor/composer/autoload_static.php
vendored
1
vendor/composer/autoload_static.php
vendored
@ -679,6 +679,7 @@ class ComposerStaticInit4d4c37b878ce01a3ff505ba7def6aac7
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\DB' => __DIR__ . '/..' . '/illuminate/container/Attributes/DB.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\Database' => __DIR__ . '/..' . '/illuminate/container/Attributes/Database.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\Log' => __DIR__ . '/..' . '/illuminate/container/Attributes/Log.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\RouteParameter' => __DIR__ . '/..' . '/illuminate/container/Attributes/RouteParameter.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\Storage' => __DIR__ . '/..' . '/illuminate/container/Attributes/Storage.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\Attributes\\Tag' => __DIR__ . '/..' . '/illuminate/container/Attributes/Tag.php',
|
||||
'RectorPrefix202410\\Illuminate\\Container\\BoundMethod' => __DIR__ . '/..' . '/illuminate/container/BoundMethod.php',
|
||||
|
38
vendor/composer/installed.json
vendored
38
vendor/composer/installed.json
vendored
@ -512,17 +512,17 @@
|
||||
},
|
||||
{
|
||||
"name": "illuminate\/container",
|
||||
"version": "v11.27.2",
|
||||
"version_normalized": "11.27.2.0",
|
||||
"version": "v11.28.0",
|
||||
"version_normalized": "11.28.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/illuminate\/container.git",
|
||||
"reference": "bc49d144a20b0d432e1ac812c9e056594b6c6480"
|
||||
"reference": "06dfc614aff58384b28ba5ad191f6a02d6b192cb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/illuminate\/container\/zipball\/bc49d144a20b0d432e1ac812c9e056594b6c6480",
|
||||
"reference": "bc49d144a20b0d432e1ac812c9e056594b6c6480",
|
||||
"url": "https:\/\/api.github.com\/repos\/illuminate\/container\/zipball\/06dfc614aff58384b28ba5ad191f6a02d6b192cb",
|
||||
"reference": "06dfc614aff58384b28ba5ad191f6a02d6b192cb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -533,7 +533,7 @@
|
||||
"provide": {
|
||||
"psr\/container-implementation": "1.1|2.0"
|
||||
},
|
||||
"time": "2024-10-08T13:34:53+00:00",
|
||||
"time": "2024-10-11T15:30:11+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -569,8 +569,8 @@
|
||||
},
|
||||
{
|
||||
"name": "illuminate\/contracts",
|
||||
"version": "v11.27.2",
|
||||
"version_normalized": "11.27.2.0",
|
||||
"version": "v11.28.0",
|
||||
"version_normalized": "11.28.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/illuminate\/contracts.git",
|
||||
@ -867,17 +867,17 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan\/phpdoc-parser",
|
||||
"version": "1.32.0",
|
||||
"version_normalized": "1.32.0.0",
|
||||
"version": "1.33.0",
|
||||
"version_normalized": "1.33.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/phpstan\/phpdoc-parser.git",
|
||||
"reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4"
|
||||
"reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/6ca22b154efdd9e3c68c56f5d94670920a1c19a4",
|
||||
"reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4",
|
||||
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/82a311fd3690fb2bf7b64d5c98f912b3dd746140",
|
||||
"reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -894,7 +894,7 @@
|
||||
"phpunit\/phpunit": "^9.5",
|
||||
"symfony\/process": "^5.2"
|
||||
},
|
||||
"time": "2024-09-26T07:23:32+00:00",
|
||||
"time": "2024-10-13T11:25:22+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -911,7 +911,7 @@
|
||||
"description": "PHPDoc parser with support for nullable, intersection and generic types",
|
||||
"support": {
|
||||
"issues": "https:\/\/github.com\/phpstan\/phpdoc-parser\/issues",
|
||||
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.32.0"
|
||||
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.33.0"
|
||||
},
|
||||
"install-path": "..\/phpstan\/phpdoc-parser"
|
||||
},
|
||||
@ -1811,12 +1811,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
|
||||
"reference": "08f5f635bfcc10cb29c74dc0645fc7730b9168e2"
|
||||
"reference": "8fabbb085727ea83aa9eecb6c5da9b7209499eef"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/08f5f635bfcc10cb29c74dc0645fc7730b9168e2",
|
||||
"reference": "08f5f635bfcc10cb29c74dc0645fc7730b9168e2",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/8fabbb085727ea83aa9eecb6c5da9b7209499eef",
|
||||
"reference": "8fabbb085727ea83aa9eecb6c5da9b7209499eef",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1840,7 +1840,7 @@
|
||||
"tomasvotruba\/class-leak": "^0.2",
|
||||
"tracy\/tracy": "^2.10"
|
||||
},
|
||||
"time": "2024-10-09T14:04:40+00:00",
|
||||
"time": "2024-10-15T14:34:50+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
33
vendor/illuminate/container/Attributes/RouteParameter.php
vendored
Normal file
33
vendor/illuminate/container/Attributes/RouteParameter.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace RectorPrefix202410\Illuminate\Container\Attributes;
|
||||
|
||||
use Attribute;
|
||||
use RectorPrefix202410\Illuminate\Contracts\Container\Container;
|
||||
use RectorPrefix202410\Illuminate\Contracts\Container\ContextualAttribute;
|
||||
#[Attribute(Attribute::TARGET_PARAMETER)]
|
||||
class RouteParameter implements ContextualAttribute
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $parameter;
|
||||
/**
|
||||
* Create a new class instance.
|
||||
*/
|
||||
public function __construct(string $parameter)
|
||||
{
|
||||
$this->parameter = $parameter;
|
||||
}
|
||||
/**
|
||||
* Resolve the route parameter.
|
||||
*
|
||||
* @param self $attribute
|
||||
* @param \Illuminate\Contracts\Container\Container $container
|
||||
* @return mixed
|
||||
*/
|
||||
public static function resolve(self $attribute, Container $container)
|
||||
{
|
||||
return $container->make('request')->route($attribute->parameter);
|
||||
}
|
||||
}
|
@ -9,6 +9,8 @@ class ArrayShapeNode implements \PHPStan\PhpDocParser\Ast\Type\TypeNode
|
||||
{
|
||||
public const KIND_ARRAY = 'array';
|
||||
public const KIND_LIST = 'list';
|
||||
public const KIND_NON_EMPTY_ARRAY = 'non-empty-array';
|
||||
public const KIND_NON_EMPTY_LIST = 'non-empty-list';
|
||||
use NodeAttributes;
|
||||
/** @var ArrayShapeItemNode[] */
|
||||
public $items;
|
||||
|
@ -141,7 +141,7 @@ class TypeParser
|
||||
$type = $this->tryParseCallable($tokens, $type, \false);
|
||||
} elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) {
|
||||
$type = $this->tryParseArrayOrOffsetAccess($tokens, $type);
|
||||
} elseif (in_array($type->name, ['array', 'list', 'object'], \true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) {
|
||||
} elseif (in_array($type->name, [Ast\Type\ArrayShapeNode::KIND_ARRAY, Ast\Type\ArrayShapeNode::KIND_LIST, Ast\Type\ArrayShapeNode::KIND_NON_EMPTY_ARRAY, Ast\Type\ArrayShapeNode::KIND_NON_EMPTY_LIST, 'object'], \true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) {
|
||||
if ($type->name === 'object') {
|
||||
$type = $this->parseObjectShape($tokens);
|
||||
} else {
|
||||
@ -474,7 +474,7 @@ class TypeParser
|
||||
}
|
||||
} elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) {
|
||||
$type = $this->tryParseArrayOrOffsetAccess($tokens, $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex));
|
||||
} elseif (in_array($type->name, ['array', 'list', 'object'], \true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) {
|
||||
} elseif (in_array($type->name, [Ast\Type\ArrayShapeNode::KIND_ARRAY, Ast\Type\ArrayShapeNode::KIND_LIST, Ast\Type\ArrayShapeNode::KIND_NON_EMPTY_ARRAY, Ast\Type\ArrayShapeNode::KIND_NON_EMPTY_LIST, 'object'], \true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) {
|
||||
if ($type->name === 'object') {
|
||||
$type = $this->parseObjectShape($tokens);
|
||||
} else {
|
||||
|
@ -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/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main e75008c'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main d9cef57'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 08f5f63'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 928f117'));
|
||||
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main e75008c'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main d9cef57'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 8fabbb0'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 928f117'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
@ -81,13 +81,12 @@ CODE_SAMPLE
|
||||
if ($node->isFirstClassCallable()) {
|
||||
return null;
|
||||
}
|
||||
$callArgs = $node->getArgs();
|
||||
$firstArg = $callArgs[0];
|
||||
$firstArg = $node->getArgs()[0];
|
||||
// special case for new map
|
||||
if ($firstArg->value instanceof New_) {
|
||||
return $this->refactorNew($firstArg->value, $node);
|
||||
}
|
||||
if (!$firstArg->value instanceof MethodCall) {
|
||||
if (!$firstArg->value instanceof MethodCall && !$firstArg->value instanceof StaticCall) {
|
||||
return null;
|
||||
}
|
||||
$nestedMethodCall = $firstArg->value;
|
||||
@ -96,7 +95,6 @@ CODE_SAMPLE
|
||||
continue;
|
||||
}
|
||||
$node->name = new Identifier($newParentMethodName);
|
||||
// move args up
|
||||
$node->args = $nestedMethodCall->args;
|
||||
return $node;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user