Skip to content

Commit f5560ca

Browse files
committed
Updated Rector to commit d562b2777ee2ded32a9418393781057bd843ea66
rectorphp/rector-src@d562b27 Rectify (#7973)
1 parent c0173ed commit f5560ca

10 files changed

Lines changed: 61 additions & 44 deletions

File tree

rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use PhpParser\Node\Expr\Variable;
1010
use PhpParser\Node\FunctionLike;
1111
use PhpParser\Node\Identifier;
12-
use PhpParser\Node\Name;
1312
use PhpParser\Node\NullableType;
1413
use PhpParser\Node\Param;
1514
use PhpParser\Node\Stmt\Class_;
@@ -20,7 +19,6 @@
2019
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
2120
use PHPStan\Reflection\ClassReflection;
2221
use PHPStan\Type\MixedType;
23-
use PHPStan\Type\Type;
2422
use PHPStan\Type\TypeCombinator;
2523
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
2624
use Rector\Contract\Rector\ConfigurableRectorInterface;
@@ -332,15 +330,15 @@ private function shouldSkipPropertyOrParam(Property $property, Param $param): bo
332330
}
333331
private function shouldRemoveNullFromForPromotedParamType(Property $property, Param $param): bool
334332
{
335-
if ($property->type === null || $param->type === null) {
333+
if (!$property->type instanceof Node || !$param->type instanceof Node) {
336334
return \false;
337335
}
338-
if ($param->default !== null && $this->valueResolver->isNull($param->default)) {
336+
if ($param->default instanceof Expr && $this->valueResolver->isNull($param->default)) {
339337
return \false;
340338
}
341339
$propertyType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($property->type);
342-
$propertyTypeWithoutNull = TypeCombinator::removeNull($propertyType);
343-
if (!$this->typeComparator->areTypesEqual($propertyTypeWithoutNull, $propertyType)) {
340+
$type = TypeCombinator::removeNull($propertyType);
341+
if (!$this->typeComparator->areTypesEqual($type, $propertyType)) {
344342
return \false;
345343
}
346344
$paramType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($param->type);
@@ -349,16 +347,16 @@ private function shouldRemoveNullFromForPromotedParamType(Property $property, Pa
349347
}
350348
private function shouldUsePropertyTypeForPromotedParam(Property $property, Param $param): bool
351349
{
352-
if ($property->type === null) {
350+
if (!$property->type instanceof Node) {
353351
return \false;
354352
}
355-
if ($param->type === null) {
353+
if (!$param->type instanceof Node) {
356354
return \true;
357355
}
358356
$propertyType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($property->type);
359-
$propertyTypeWithoutNull = TypeCombinator::removeNull($propertyType);
357+
$type = TypeCombinator::removeNull($propertyType);
360358
$paramType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($param->type);
361359
$paramTypeWithoutNull = TypeCombinator::removeNull($paramType);
362-
return $this->typeComparator->areTypesEqual($propertyTypeWithoutNull, $paramTypeWithoutNull);
360+
return $this->typeComparator->areTypesEqual($type, $paramTypeWithoutNull);
363361
}
364362
}

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = 'e300872cbb4483292cc39a3ea2211ad6a37ab457';
22+
public const PACKAGE_VERSION = 'd562b2777ee2ded32a9418393781057bd843ea66';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2026-04-23 17:48:18';
27+
public const RELEASE_DATE = '2026-04-27 11:21:32';
2828
/**
2929
* @var int
3030
*/

vendor/composer/installed.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,8 @@
574574
},
575575
{
576576
"name": "illuminate\/contracts",
577-
"version": "v12.57.0",
578-
"version_normalized": "12.57.0.0",
577+
"version": "v12.58.0",
578+
"version_normalized": "12.58.0.0",
579579
"source": {
580580
"type": "git",
581581
"url": "https:\/\/github.com\/illuminate\/contracts.git",
@@ -2335,8 +2335,8 @@
23352335
},
23362336
{
23372337
"name": "symfony\/polyfill-ctype",
2338-
"version": "v1.36.0",
2339-
"version_normalized": "1.36.0.0",
2338+
"version": "v1.37.0",
2339+
"version_normalized": "1.37.0.0",
23402340
"source": {
23412341
"type": "git",
23422342
"url": "https:\/\/github.com\/symfony\/polyfill-ctype.git",
@@ -2397,7 +2397,7 @@
23972397
"portable"
23982398
],
23992399
"support": {
2400-
"source": "https:\/\/github.com\/symfony\/polyfill-ctype\/tree\/v1.36.0"
2400+
"source": "https:\/\/github.com\/symfony\/polyfill-ctype\/tree\/v1.37.0"
24012401
},
24022402
"funding": [
24032403
{
@@ -2421,17 +2421,17 @@
24212421
},
24222422
{
24232423
"name": "symfony\/polyfill-intl-grapheme",
2424-
"version": "v1.36.0",
2425-
"version_normalized": "1.36.0.0",
2424+
"version": "v1.37.0",
2425+
"version_normalized": "1.37.0.0",
24262426
"source": {
24272427
"type": "git",
24282428
"url": "https:\/\/github.com\/symfony\/polyfill-intl-grapheme.git",
2429-
"reference": "ad1b7b9092976d6c948b8a187cec9faaea9ec1df"
2429+
"reference": "4864388bfbd3001ce88e234fab652acd91fdc57e"
24302430
},
24312431
"dist": {
24322432
"type": "zip",
2433-
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-intl-grapheme\/zipball\/ad1b7b9092976d6c948b8a187cec9faaea9ec1df",
2434-
"reference": "ad1b7b9092976d6c948b8a187cec9faaea9ec1df",
2433+
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-intl-grapheme\/zipball\/4864388bfbd3001ce88e234fab652acd91fdc57e",
2434+
"reference": "4864388bfbd3001ce88e234fab652acd91fdc57e",
24352435
"shasum": ""
24362436
},
24372437
"require": {
@@ -2440,7 +2440,7 @@
24402440
"suggest": {
24412441
"ext-intl": "For best performance"
24422442
},
2443-
"time": "2026-04-10T16:19:22+00:00",
2443+
"time": "2026-04-26T13:13:48+00:00",
24442444
"type": "library",
24452445
"extra": {
24462446
"thanks": {
@@ -2482,7 +2482,7 @@
24822482
"shim"
24832483
],
24842484
"support": {
2485-
"source": "https:\/\/github.com\/symfony\/polyfill-intl-grapheme\/tree\/v1.36.0"
2485+
"source": "https:\/\/github.com\/symfony\/polyfill-intl-grapheme\/tree\/v1.37.0"
24862486
},
24872487
"funding": [
24882488
{
@@ -2506,8 +2506,8 @@
25062506
},
25072507
{
25082508
"name": "symfony\/polyfill-intl-normalizer",
2509-
"version": "v1.36.0",
2510-
"version_normalized": "1.36.0.0",
2509+
"version": "v1.37.0",
2510+
"version_normalized": "1.37.0.0",
25112511
"source": {
25122512
"type": "git",
25132513
"url": "https:\/\/github.com\/symfony\/polyfill-intl-normalizer.git",
@@ -2570,7 +2570,7 @@
25702570
"shim"
25712571
],
25722572
"support": {
2573-
"source": "https:\/\/github.com\/symfony\/polyfill-intl-normalizer\/tree\/v1.36.0"
2573+
"source": "https:\/\/github.com\/symfony\/polyfill-intl-normalizer\/tree\/v1.37.0"
25742574
},
25752575
"funding": [
25762576
{
@@ -2594,8 +2594,8 @@
25942594
},
25952595
{
25962596
"name": "symfony\/polyfill-mbstring",
2597-
"version": "v1.36.0",
2598-
"version_normalized": "1.36.0.0",
2597+
"version": "v1.37.0",
2598+
"version_normalized": "1.37.0.0",
25992599
"source": {
26002600
"type": "git",
26012601
"url": "https:\/\/github.com\/symfony\/polyfill-mbstring.git",
@@ -2658,7 +2658,7 @@
26582658
"shim"
26592659
],
26602660
"support": {
2661-
"source": "https:\/\/github.com\/symfony\/polyfill-mbstring\/tree\/v1.36.0"
2661+
"source": "https:\/\/github.com\/symfony\/polyfill-mbstring\/tree\/v1.37.0"
26622662
},
26632663
"funding": [
26642664
{
@@ -2682,8 +2682,8 @@
26822682
},
26832683
{
26842684
"name": "symfony\/polyfill-php84",
2685-
"version": "v1.36.0",
2686-
"version_normalized": "1.36.0.0",
2685+
"version": "v1.37.0",
2686+
"version_normalized": "1.37.0.0",
26872687
"source": {
26882688
"type": "git",
26892689
"url": "https:\/\/github.com\/symfony\/polyfill-php84.git",
@@ -2741,7 +2741,7 @@
27412741
"shim"
27422742
],
27432743
"support": {
2744-
"source": "https:\/\/github.com\/symfony\/polyfill-php84\/tree\/v1.36.0"
2744+
"source": "https:\/\/github.com\/symfony\/polyfill-php84\/tree\/v1.37.0"
27452745
},
27462746
"funding": [
27472747
{
@@ -2765,23 +2765,23 @@
27652765
},
27662766
{
27672767
"name": "symfony\/polyfill-php85",
2768-
"version": "v1.36.0",
2769-
"version_normalized": "1.36.0.0",
2768+
"version": "v1.37.0",
2769+
"version_normalized": "1.37.0.0",
27702770
"source": {
27712771
"type": "git",
27722772
"url": "https:\/\/github.com\/symfony\/polyfill-php85.git",
2773-
"reference": "2c408a6bb0313e6001a83628dc5506100474254e"
2773+
"reference": "fcfa4973a9917cef23f2e38774da74a2b7d115ee"
27742774
},
27752775
"dist": {
27762776
"type": "zip",
2777-
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-php85\/zipball\/2c408a6bb0313e6001a83628dc5506100474254e",
2778-
"reference": "2c408a6bb0313e6001a83628dc5506100474254e",
2777+
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-php85\/zipball\/fcfa4973a9917cef23f2e38774da74a2b7d115ee",
2778+
"reference": "fcfa4973a9917cef23f2e38774da74a2b7d115ee",
27792779
"shasum": ""
27802780
},
27812781
"require": {
27822782
"php": ">=7.2"
27832783
},
2784-
"time": "2026-04-10T16:50:15+00:00",
2784+
"time": "2026-04-26T13:10:57+00:00",
27852785
"type": "library",
27862786
"extra": {
27872787
"thanks": {
@@ -2824,7 +2824,7 @@
28242824
"shim"
28252825
],
28262826
"support": {
2827-
"source": "https:\/\/github.com\/symfony\/polyfill-php85\/tree\/v1.36.0"
2827+
"source": "https:\/\/github.com\/symfony\/polyfill-php85\/tree\/v1.37.0"
28282828
},
28292829
"funding": [
28302830
{

0 commit comments

Comments
 (0)