Skip to content

Commit b8576e7

Browse files
committed
Updated Rector to commit 3be6fd7636ee24d82606f6166f94d8372fee800d
rectorphp/rector-src@3be6fd7 Clean up repetitive recursive call and flag on ArrayKeyFirstLastRector (#6889)
1 parent 31d1a75 commit b8576e7

File tree

6 files changed

+19
-11
lines changed

6 files changed

+19
-11
lines changed

vendor/composer/installed.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,12 +1748,12 @@
17481748
"source": {
17491749
"type": "git",
17501750
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
1751-
"reference": "3a83d1d08d10d5c2c461727ffcaed8fea934ee37"
1751+
"reference": "9d2e956a47127bcc2a1c901d6a5f1ff7fc25c753"
17521752
},
17531753
"dist": {
17541754
"type": "zip",
1755-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/3a83d1d08d10d5c2c461727ffcaed8fea934ee37",
1756-
"reference": "3a83d1d08d10d5c2c461727ffcaed8fea934ee37",
1755+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/9d2e956a47127bcc2a1c901d6a5f1ff7fc25c753",
1756+
"reference": "9d2e956a47127bcc2a1c901d6a5f1ff7fc25c753",
17571757
"shasum": ""
17581758
},
17591759
"require": {
@@ -1771,7 +1771,7 @@
17711771
"tomasvotruba\/class-leak": "^1.0",
17721772
"tracy\/tracy": "^2.10"
17731773
},
1774-
"time": "2025-05-10T12:53:49+00:00",
1774+
"time": "2025-05-10T14:49:17+00:00",
17751775
"default-branch": true,
17761776
"type": "rector-extension",
17771777
"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 d996ef3'), '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 3a83d1d'), '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 462d1a9'), '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 9cb58c1'));
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 d996ef3'), '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 9d2e956'), '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 462d1a9'), '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 9cb58c1'));
1313
private function __construct()
1414
{
1515
}

vendor/rector/rector-downgrade-php/rules/DowngradePhp80/Rector/Instanceof_/DowngradeInstanceofStringableRector.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
namespace Rector\DowngradePhp80\Rector\Instanceof_;
55

66
use PhpParser\Node;
7+
use PhpParser\Node\Expr\BinaryOp\BooleanAnd;
8+
use PhpParser\Node\Expr\FuncCall;
79
use PhpParser\Node\Expr\Instanceof_;
810
use PhpParser\Node\Name\FullyQualified;
911
use PhpParser\Node\Scalar\String_;
@@ -22,7 +24,7 @@ public function getRuleDefinition() : RuleDefinition
2224
$obj instanceof \Stringable;
2325
CODE_SAMPLE
2426
, <<<'CODE_SAMPLE'
25-
method_exists($obj, '__toString');
27+
is_object($obj) && method_exists($obj, '__toString');
2628
CODE_SAMPLE
2729
)]);
2830
}
@@ -35,15 +37,21 @@ public function getNodeTypes() : array
3537
}
3638
/**
3739
* @param Instanceof_ $node
40+
* @return null|\PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\BinaryOp\BooleanAnd
3841
*/
39-
public function refactor(Node $node) : ?Node
42+
public function refactor(Node $node)
4043
{
4144
if (!$node->class instanceof FullyQualified) {
4245
return null;
4346
}
4447
if (!$this->isName($node->class, 'Stringable')) {
4548
return null;
4649
}
47-
return $this->nodeFactory->createFuncCall('method_exists', [$node->expr, new String_('__toString')]);
50+
$nativeExprType = $this->nodeTypeResolver->getNativeType($node->expr);
51+
$funcCall = $this->nodeFactory->createFuncCall('method_exists', [$node->expr, new String_('__toString')]);
52+
if ($nativeExprType->isObject()->yes()) {
53+
return $funcCall;
54+
}
55+
return new BooleanAnd($this->nodeFactory->createFuncCall('is_object', [$node->expr]), $funcCall);
4856
}
4957
}

vendor/symfony/console/Helper/Table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ private function fillNextRows(array $rows, int $line) : array
585585
{
586586
$unmergedRows = [];
587587
foreach ($rows[$line] as $column => $cell) {
588-
if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !\method_exists($cell, '__toString')) {
588+
if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !(\is_object($cell) && \method_exists($cell, '__toString'))) {
589589
throw new InvalidArgumentException(\sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', \get_debug_type($cell)));
590590
}
591591
if ($cell instanceof TableCell && $cell->getRowspan() > 1) {

vendor/symfony/console/Logger/ConsoleLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private function interpolate(string $message, array $context) : string
7474
}
7575
$replacements = [];
7676
foreach ($context as $key => $val) {
77-
if (null === $val || \is_scalar($val) || \method_exists($val, '__toString')) {
77+
if (null === $val || \is_scalar($val) || \is_object($val) && \method_exists($val, '__toString')) {
7878
$replacements["{{$key}}"] = $val;
7979
} elseif ($val instanceof \DateTimeInterface) {
8080
$replacements["{{$key}}"] = $val->format(\DateTimeInterface::RFC3339);

0 commit comments

Comments
 (0)