Skip to content

Commit 0696504

Browse files
committed
Updated Rector to commit 17f8d5c4e5a4041850e4c2e9453bf7288387094d
rectorphp/rector-src@17f8d5c [internal] Remove duplicated enterNode() type check already handled in node traverser (#7717)
1 parent bf2db67 commit 0696504

File tree

11 files changed

+35
-40
lines changed

11 files changed

+35
-40
lines changed

rules/Naming/Naming/ExpectedNameResolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@ public function resolveForForeach(VariableAndCallForeach $variableAndCallForeach
151151
}
152152
$expectedNameFromType = $this->propertyNaming->getExpectedNameFromType($innerReturnedType ?? $returnedType);
153153
if ($this->isReturnedTypeAnArrayAndExpectedNameFromTypeNotNull($returnedType, $expectedNameFromType)) {
154-
return ($nullsafeVariable2 = $expectedNameFromType) ? $nullsafeVariable2->getSingularized() : null;
154+
return ($nullsafeVariable1 = $expectedNameFromType) ? $nullsafeVariable1->getSingularized() : null;
155155
}
156156
$expectedNameFromMethodName = $this->propertyNaming->getExpectedNameFromMethodName($name);
157157
if (!$expectedNameFromMethodName instanceof ExpectedName) {
158-
return ($nullsafeVariable3 = $expectedNameFromType) ? $nullsafeVariable3->getSingularized() : null;
158+
return ($nullsafeVariable2 = $expectedNameFromType) ? $nullsafeVariable2->getSingularized() : null;
159159
}
160160
if ($expectedNameFromMethodName->isSingular()) {
161-
return ($nullsafeVariable4 = $expectedNameFromType) ? $nullsafeVariable4->getSingularized() : null;
161+
return ($nullsafeVariable3 = $expectedNameFromType) ? $nullsafeVariable3->getSingularized() : null;
162162
}
163163
return $expectedNameFromMethodName->getSingularized();
164164
}

vendor/composer/installed.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,12 +1877,12 @@
18771877
"source": {
18781878
"type": "git",
18791879
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
1880-
"reference": "8360bd1cfa6fc2d2bd06c77e346e4be668b3791a"
1880+
"reference": "757db77d4505ae7ff2fff5e35c5494fd7b428c82"
18811881
},
18821882
"dist": {
18831883
"type": "zip",
1884-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/8360bd1cfa6fc2d2bd06c77e346e4be668b3791a",
1885-
"reference": "8360bd1cfa6fc2d2bd06c77e346e4be668b3791a",
1884+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/757db77d4505ae7ff2fff5e35c5494fd7b428c82",
1885+
"reference": "757db77d4505ae7ff2fff5e35c5494fd7b428c82",
18861886
"shasum": ""
18871887
},
18881888
"require": {
@@ -1914,7 +1914,7 @@
19141914
"tomasvotruba\/unused-public": "^2.1",
19151915
"tracy\/tracy": "^2.11"
19161916
},
1917-
"time": "2025-12-18T00:19:24+00:00",
1917+
"time": "2025-12-20T15:00:25+00:00",
19181918
"default-branch": true,
19191919
"type": "rector-extension",
19201920
"extra": {

vendor/composer/installed.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

vendor/rector/extension-installer/src/GeneratedConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
final class GeneratedConfig
1111
{
12-
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 5366b9a'), '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 1543cbe'), '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 6d2b1ba'), '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 8360bd1'));
12+
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 5366b9a'), '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 1543cbe'), '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 6d2b1ba'), '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 757db77'));
1313
private function __construct()
1414
{
1515
}

vendor/rector/rector-phpunit/rules/CodeQuality/Reflection/MethodParametersAndReturnTypesResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function resolveParameterTypes(ExtendedMethodReflection $extendedMethodRe
150150
$parameterTypes = [];
151151
foreach ($extendedParametersAcceptor->getParameters() as $extendedParameterReflection) {
152152
$parameterType = $this->resolveObjectType($extendedParameterReflection->getNativeType());
153-
if ($parameterType instanceof ObjectType && $currentClassReflection->getName() !== (($nullsafeVariable3 = $parameterType->getClassReflection()) ? $nullsafeVariable3->getName() : null)) {
153+
if ($parameterType instanceof ObjectType && $currentClassReflection->getName() !== (($nullsafeVariable1 = $parameterType->getClassReflection()) ? $nullsafeVariable1->getName() : null)) {
154154
$parameterTypes[] = new MixedType();
155155
continue;
156156
}
@@ -187,7 +187,7 @@ private function resolveReturnType(ExtendedMethodReflection $extendedMethodRefle
187187
{
188188
$extendedParametersAcceptor = ParametersAcceptorSelector::combineAcceptors($extendedMethodReflection->getVariants());
189189
$returnType = $this->resolveObjectType($extendedParametersAcceptor->getNativeReturnType());
190-
if ($returnType instanceof ObjectType && $currentClassReflection->getName() !== (($nullsafeVariable4 = $returnType->getClassReflection()) ? $nullsafeVariable4->getName() : null)) {
190+
if ($returnType instanceof ObjectType && $currentClassReflection->getName() !== (($nullsafeVariable2 = $returnType->getClassReflection()) ? $nullsafeVariable2->getName() : null)) {
191191
return new MixedType();
192192
}
193193
return $returnType;

vendor/rector/rector-symfony/rules/Symfony73/NodeAnalyzer/CommandOptionsResolver.php

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use PhpParser\Node\Arg;
77
use PhpParser\Node\Expr;
8+
use PhpParser\Node\Expr\MethodCall;
89
use PhpParser\Node\Stmt\ClassMethod;
910
use PHPStan\Type\Type;
1011
use Rector\NodeTypeResolver\NodeTypeResolver;
@@ -39,43 +40,37 @@ public function resolve(ClassMethod $configureClassMethod): array
3940
$addOptionMethodCalls = $this->methodCallFinder->find($configureClassMethod, 'addOption');
4041
$commandOptions = [];
4142
foreach ($addOptionMethodCalls as $addOptionMethodCall) {
42-
$addOptionArgs = $addOptionMethodCall->getArgs();
43-
$optionName = $this->valueResolver->getValue($addOptionArgs[0]->value);
44-
$isImplicitBoolean = $this->isImplicitBoolean($addOptionArgs);
45-
$commandOptions[] = new CommandOption($optionName, $addOptionArgs[0]->value, $addOptionArgs[1]->value ?? null, $addOptionArgs[2]->value ?? null, $addOptionArgs[3]->value ?? null, $addOptionArgs[4]->value ?? null, $this->isArrayMode($addOptionArgs), $isImplicitBoolean, $this->resolveDefaultType($addOptionArgs));
43+
$nameArg = $addOptionMethodCall->getArg('name', 0);
44+
if (!$nameArg instanceof Arg) {
45+
continue;
46+
}
47+
$optionName = $this->valueResolver->getValue($nameArg->value);
48+
$isImplicitBoolean = $this->isImplicitBoolean($addOptionMethodCall);
49+
$commandOptions[] = new CommandOption($optionName, $nameArg->value, ($nullsafeVariable2 = $addOptionMethodCall->getArg('shortcut', 1)) ? $nullsafeVariable2->value : null, ($nullsafeVariable3 = $addOptionMethodCall->getArg('mode', 2)) ? $nullsafeVariable3->value : null, ($nullsafeVariable4 = $addOptionMethodCall->getArg('description', 3)) ? $nullsafeVariable4->value : null, ($nullsafeVariable5 = $addOptionMethodCall->getArg('default', 4)) ? $nullsafeVariable5->value : null, $this->isArrayMode($addOptionMethodCall), $isImplicitBoolean, $this->resolveDefaultType($addOptionMethodCall));
4650
}
4751
return $commandOptions;
4852
}
49-
/**
50-
* @param Arg[] $args
51-
*/
52-
private function resolveDefaultType(array $args): ?Type
53+
private function resolveDefaultType(MethodCall $methodCall): ?Type
5354
{
54-
$defaultArg = $args[4] ?? null;
55-
if (!$defaultArg instanceof Arg) {
55+
$defaultExpr = ($nullsafeVariable6 = $methodCall->getArg('default', 4)) ? $nullsafeVariable6->value : null;
56+
if (!$defaultExpr instanceof Expr) {
5657
return null;
5758
}
58-
return $this->nodeTypeResolver->getType($defaultArg->value);
59+
return $this->nodeTypeResolver->getType($defaultExpr);
5960
}
60-
/**
61-
* @param Arg[] $args
62-
*/
63-
private function isArrayMode(array $args): bool
61+
private function isArrayMode(MethodCall $methodCall): bool
6462
{
65-
$modeExpr = $args[2]->value ?? null;
63+
$modeExpr = ($nullsafeVariable7 = $methodCall->getArg('mode', 2)) ? $nullsafeVariable7->value : null;
6664
if (!$modeExpr instanceof Expr) {
6765
return \false;
6866
}
6967
$modeValue = $this->valueResolver->getValue($modeExpr);
7068
// binary check for InputOption::VALUE_IS_ARRAY
7169
return (bool) ($modeValue & 8);
7270
}
73-
/**
74-
* @param Arg[] $args
75-
*/
76-
private function isImplicitBoolean(array $args): bool
71+
private function isImplicitBoolean(MethodCall $methodCall): bool
7772
{
78-
$modeExpr = $args[2]->value ?? null;
73+
$modeExpr = ($nullsafeVariable8 = $methodCall->getArg('mode', 2)) ? $nullsafeVariable8->value : null;
7974
if (!$modeExpr instanceof Expr) {
8075
return \false;
8176
}

vendor/sebastian/diff/src/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private function parseFileDiff(Diff $diff, array $lines): void
7979
$type = Line::REMOVED;
8080
}
8181
$diffLines[] = new Line($type, $match['line']);
82-
($nullsafeVariable1 = $chunk) ? $nullsafeVariable1->setLines($diffLines) : null;
82+
($nullsafeVariable2 = $chunk) ? $nullsafeVariable2->setLines($diffLines) : null;
8383
}
8484
}
8585
$diff->setChunks($chunks);

vendor/symfony/console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ public function get(string $name)
523523
public function has(string $name): bool
524524
{
525525
$this->init();
526-
return isset($this->commands[$name]) || (($nullsafeVariable2 = $this->commandLoader) ? $nullsafeVariable2->has($name) : null) && $this->add($this->commandLoader->get($name));
526+
return isset($this->commands[$name]) || (($nullsafeVariable3 = $this->commandLoader) ? $nullsafeVariable3->has($name) : null) && $this->add($this->commandLoader->get($name));
527527
}
528528
/**
529529
* Returns an array of all unique namespaces used by currently registered commands.

vendor/symfony/console/Command/Command.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public function addArgument(string $name, ?int $mode = null, string $description
421421
throw new \TypeError(\sprintf('Argument 5 passed to "%s()" must be array or \Closure, "%s" given.', __METHOD__, get_debug_type($suggestedValues)));
422422
}
423423
$this->definition->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues));
424-
($nullsafeVariable2 = $this->fullDefinition) ? $nullsafeVariable2->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues)) : null;
424+
($nullsafeVariable9 = $this->fullDefinition) ? $nullsafeVariable9->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues)) : null;
425425
return $this;
426426
}
427427
/**
@@ -445,7 +445,7 @@ public function addOption(string $name, $shortcut = null, ?int $mode = null, str
445445
throw new \TypeError(\sprintf('Argument 5 passed to "%s()" must be array or \Closure, "%s" given.', __METHOD__, get_debug_type($suggestedValues)));
446446
}
447447
$this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues));
448-
($nullsafeVariable3 = $this->fullDefinition) ? $nullsafeVariable3->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues)) : null;
448+
($nullsafeVariable10 = $this->fullDefinition) ? $nullsafeVariable10->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues)) : null;
449449
return $this;
450450
}
451451
/**
@@ -544,7 +544,7 @@ public function getHelp(): string
544544
public function getProcessedHelp(): string
545545
{
546546
$name = $this->name;
547-
$isSingleCommand = ($nullsafeVariable4 = $this->application) ? $nullsafeVariable4->isSingleCommand() : null;
547+
$isSingleCommand = ($nullsafeVariable11 = $this->application) ? $nullsafeVariable11->isSingleCommand() : null;
548548
$placeholders = ['%command.name%', '%command.full_name%'];
549549
$replacements = [$name, $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'] . ' ' . $name];
550550
return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription());

vendor/symfony/console/Completion/CompletionInput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function bind(InputDefinition $definition): void
6969
$this->completionValue = $relevantToken;
7070
return;
7171
}
72-
if (($nullsafeVariable5 = $option) ? $nullsafeVariable5->acceptValue() : null) {
72+
if (($nullsafeVariable12 = $option) ? $nullsafeVariable12->acceptValue() : null) {
7373
$this->completionType = self::TYPE_OPTION_VALUE;
7474
$this->completionName = $option->getName();
7575
$this->completionValue = $optionValue ?: (strncmp($optionToken, '--', strlen('--')) !== 0 ? (string) substr($optionToken, 2) : '');
@@ -80,7 +80,7 @@ public function bind(InputDefinition $definition): void
8080
if ('-' === $previousToken[0] && '' !== trim($previousToken, '-')) {
8181
// check if previous option accepted a value
8282
$previousOption = $this->getOptionFromToken($previousToken);
83-
if (($nullsafeVariable6 = $previousOption) ? $nullsafeVariable6->acceptValue() : null) {
83+
if (($nullsafeVariable13 = $previousOption) ? $nullsafeVariable13->acceptValue() : null) {
8484
$this->completionType = self::TYPE_OPTION_VALUE;
8585
$this->completionName = $previousOption->getName();
8686
$this->completionValue = $relevantToken;

0 commit comments

Comments
 (0)