mirror of https://github.com/rectorphp/rector.git
Compare commits
3 Commits
8aefc5e967
...
584e892a51
Author | SHA1 | Date |
---|---|---|
Tomas Votruba | 584e892a51 | |
Tomas Votruba | b9839a24cb | |
Tomas Votruba | 1e8aeb3de9 |
|
@ -13,6 +13,7 @@ use PhpParser\Node\Stmt\Function_;
|
|||
use PHPStan\Analyser\Scope;
|
||||
use PHPStan\Reflection\FunctionReflection;
|
||||
use PHPStan\Reflection\MethodReflection;
|
||||
use PHPStan\Reflection\Native\NativeFunctionReflection;
|
||||
use Rector\CodingStyle\Reflection\VendorLocationDetector;
|
||||
use Rector\NodeTypeResolver\PHPStan\ParametersAcceptorSelectorVariantsWrapper;
|
||||
use Rector\Php80\NodeResolver\ArgumentSorter;
|
||||
|
@ -178,6 +179,9 @@ CODE_SAMPLE
|
|||
*/
|
||||
private function resolveExpectedArgParamOrderIfDifferent($reflection, $node, Scope $scope) : ?array
|
||||
{
|
||||
if ($reflection instanceof NativeFunctionReflection) {
|
||||
return null;
|
||||
}
|
||||
if ($reflection instanceof MethodReflection && $this->vendorLocationDetector->detectMethodReflection($reflection)) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -121,13 +121,16 @@ final class ClassRenamer
|
|||
$classReflection = $this->reflectionProvider->getClass($newName);
|
||||
return $classReflection->isInterface();
|
||||
}
|
||||
return $fullyQualified->getAttribute(AttributeKey::IS_FUNCCALL_NAME) === \true;
|
||||
return \false;
|
||||
}
|
||||
/**
|
||||
* @param array<string, string> $oldToNewClasses
|
||||
*/
|
||||
private function refactorName(FullyQualified $fullyQualified, array $oldToNewClasses) : ?FullyQualified
|
||||
{
|
||||
if ($fullyQualified->getAttribute(AttributeKey::IS_FUNCCALL_NAME) === \true) {
|
||||
return null;
|
||||
}
|
||||
$stringName = $fullyQualified->toString();
|
||||
$newName = $oldToNewClasses[$stringName] ?? null;
|
||||
if ($newName === null) {
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '1374e15d742f4f36f0bef45db9f8920a589865b3';
|
||||
public const PACKAGE_VERSION = '068799f59b289bef06b9c1f384df4301b19e726e';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-04-20 17:59:14';
|
||||
public const RELEASE_DATE = '2024-04-21 02:27:01';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -1866,12 +1866,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
|
||||
"reference": "607447eab503bea12913c9ddce690c6055424acd"
|
||||
"reference": "b8126e8bf6e239fd53329fcd715ea117a4b4c34c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/607447eab503bea12913c9ddce690c6055424acd",
|
||||
"reference": "607447eab503bea12913c9ddce690c6055424acd",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/b8126e8bf6e239fd53329fcd715ea117a4b4c34c",
|
||||
"reference": "b8126e8bf6e239fd53329fcd715ea117a4b4c34c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1900,7 +1900,7 @@
|
|||
"tomasvotruba\/class-leak": "^0.2.6",
|
||||
"tracy\/tracy": "^2.10"
|
||||
},
|
||||
"time": "2024-04-09T22:40:17+00:00",
|
||||
"time": "2024-04-20T20:01:42+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
|
|
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/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main b3da143'), '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 05e44cf'), '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 e8af39b'), '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 607447e'));
|
||||
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 b3da143'), '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 05e44cf'), '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 e8af39b'), '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 b8126e8'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -137,12 +137,15 @@ CODE_SAMPLE
|
|||
}
|
||||
$configVariable = $this->createConfigVariable($configClass);
|
||||
$stmts = $this->createMethodCallStmts($extensionKeyAndConfiguration->getArray(), $configVariable);
|
||||
if ($stmts === null) {
|
||||
return null;
|
||||
}
|
||||
return $this->symfonyClosureFactory->create($configClass, $node, $stmts);
|
||||
}
|
||||
/**
|
||||
* @return array<Expression<MethodCall>>
|
||||
*/
|
||||
private function createMethodCallStmts(Array_ $configurationArray, Variable $configVariable) : array
|
||||
private function createMethodCallStmts(Array_ $configurationArray, Variable $configVariable) : ?array
|
||||
{
|
||||
$methodCallStmts = [];
|
||||
$configurationValues = $this->valueResolver->getValue($configurationArray);
|
||||
|
@ -180,6 +183,9 @@ CODE_SAMPLE
|
|||
} else {
|
||||
$currentConfigCaller = $configVariable;
|
||||
}
|
||||
if (!\is_array($value)) {
|
||||
return null;
|
||||
}
|
||||
foreach ($value as $itemName => $itemConfiguration) {
|
||||
if ($nested && \is_array($itemConfiguration)) {
|
||||
$methodCallName = $itemName;
|
||||
|
|
Loading…
Reference in New Issue