Skip to content

Commit 4f3157a

Browse files
committed
Updated Rector to commit c4b68d5fd646875fa96f68941e4b2b643a06d1f8
rectorphp/rector-src@c4b68d5 [Php70] Handle class named Pool on Php4ConstructorRector (#6887)
1 parent 7341223 commit 4f3157a

5 files changed

Lines changed: 19 additions & 9 deletions

File tree

vendor/composer/installed.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,12 +1866,12 @@
18661866
"source": {
18671867
"type": "git",
18681868
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
1869-
"reference": "9f83efbeb0b555ddc790199cfec6a8fe18c72eb7"
1869+
"reference": "3234dd8a2a60c0deb6e232a7c820b20a8e7a4726"
18701870
},
18711871
"dist": {
18721872
"type": "zip",
1873-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/9f83efbeb0b555ddc790199cfec6a8fe18c72eb7",
1874-
"reference": "9f83efbeb0b555ddc790199cfec6a8fe18c72eb7",
1873+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/3234dd8a2a60c0deb6e232a7c820b20a8e7a4726",
1874+
"reference": "3234dd8a2a60c0deb6e232a7c820b20a8e7a4726",
18751875
"shasum": ""
18761876
},
18771877
"require": {
@@ -1900,7 +1900,7 @@
19001900
"tomasvotruba\/unused-public": "^2.0",
19011901
"tracy\/tracy": "^2.10"
19021902
},
1903-
"time": "2025-05-07T11:24:29+00:00",
1903+
"time": "2025-05-07T12:42:13+00:00",
19041904
"default-branch": true,
19051905
"type": "rector-extension",
19061906
"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 826f808'), '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 2b141c8'), '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 96b3565'), '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 9f83efb'));
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 826f808'), '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 2b141c8'), '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 96b3565'), '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 3234dd8'));
1313
private function __construct()
1414
{
1515
}

vendor/rector/rector-symfony/rules/CodeQuality/Rector/ClassMethod/TemplateAnnotationToThisRenderRector.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
declare (strict_types=1);
44
namespace Rector\Symfony\CodeQuality\Rector\ClassMethod;
55

6+
use PhpParser\Node\Expr\New_;
67
use PhpParser\Node;
78
use PhpParser\Node\Attribute;
89
use PhpParser\Node\Expr;
@@ -37,6 +38,7 @@
3738
use Rector\Symfony\NodeFinder\EmptyReturnNodeFinder;
3839
use Rector\Symfony\TypeAnalyzer\ArrayUnionResponseTypeAnalyzer;
3940
use Rector\Symfony\TypeDeclaration\ReturnTypeDeclarationUpdater;
41+
use RectorPrefix202505\Symfony\Component\HttpFoundation\Response;
4042
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
4143
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
4244
/**
@@ -261,7 +263,14 @@ private function refactorReturnWithValue(Return_ $return, bool $hasThisRenderOrR
261263
/** @var Expr $lastReturnExpr */
262264
$lastReturnExpr = $return->expr;
263265
$returnStaticType = $this->getType($lastReturnExpr);
264-
if (!$return->expr instanceof MethodCall) {
266+
// is new response? keep it
267+
$isResponseType = \false;
268+
if ($return->expr instanceof New_) {
269+
$new = $return->expr;
270+
if ($this->isObjectType($new->class, new ObjectType(Response::class))) {
271+
$isResponseType = \true;
272+
}
273+
} elseif (!$return->expr instanceof MethodCall) {
265274
if (!$hasThisRenderOrReturnsResponse || $returnStaticType instanceof ConstantArrayType) {
266275
$return->expr = $thisRenderMethodCall;
267276
}
@@ -273,7 +282,7 @@ private function refactorReturnWithValue(Return_ $return, bool $hasThisRenderOrR
273282
}
274283
$isArrayOrResponseType = $this->arrayUnionResponseTypeAnalyzer->isArrayUnionResponseType($returnStaticType, SymfonyClass::RESPONSE);
275284
// skip as the original class method has to change first
276-
if ($isArrayOrResponseType) {
285+
if ($isArrayOrResponseType && $isResponseType === \false) {
277286
return \false;
278287
}
279288
// already response

vendor/rector/rector-symfony/src/NodeFactory/Annotations/AnnotationOrAttributeValueResolver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
declare (strict_types=1);
44
namespace Rector\Symfony\NodeFactory\Annotations;
55

6+
use PhpParser\Node\Identifier;
67
use PhpParser\Node\Arg;
78
use PhpParser\Node\Attribute;
89
use PhpParser\Node\Scalar\String_;
@@ -53,7 +54,7 @@ public function resolve($tagValueNodeOrAttribute, string $desiredKey)
5354
}
5455
private function isKeyEmptyOrMatch(Arg $attributeArg, string $desiredKey) : bool
5556
{
56-
if ($attributeArg->name === null) {
57+
if (!$attributeArg->name instanceof Identifier) {
5758
return \true;
5859
}
5960
return $attributeArg->name->toString() === $desiredKey;

0 commit comments

Comments
 (0)