Skip to content

Commit

Permalink
Updated Rector to commit 61016bf5307b804df5babb81db27cacbccb12efa
Browse files Browse the repository at this point in the history
rectorphp/rector-src@61016bf [CodeQuality] Use existing PhpAttributeAnalyzer service instead of AttributeFinder from Doctrine package on DynamicDocBlockPropertyToNativePropertyRector (#6382)
  • Loading branch information
TomasVotruba committed Oct 15, 2024
1 parent 1a957f8 commit adf15bb
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 27 deletions.
1 change: 1 addition & 0 deletions vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@
'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',
Expand Down
1 change: 1 addition & 0 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
38 changes: 19 additions & 19 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -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"
},
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/installed.php

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions vendor/illuminate/container/Attributes/RouteParameter.php
Original file line number Diff line number Diff line change
@@ -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);
}
}
2 changes: 2 additions & 0 deletions vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private function parseAtomic(\PHPStan\PhpDocParser\Parser\TokenIterator $tokens)
$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 {
Expand Down Expand Up @@ -474,7 +474,7 @@ private function parseCallableReturnType(\PHPStan\PhpDocParser\Parser\TokenItera
}
} 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 {
Expand Down
2 changes: 1 addition & 1 deletion vendor/rector/extension-installer/src/GeneratedConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
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()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,12 @@ public function refactor(Node $node) : ?Node
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;
Expand All @@ -96,7 +95,6 @@ public function refactor(Node $node) : ?Node
continue;
}
$node->name = new Identifier($newParentMethodName);
// move args up
$node->args = $nestedMethodCall->args;
return $node;
}
Expand Down

0 comments on commit adf15bb

Please sign in to comment.