8000 Bump to PHP-Parser ^5.5.0 (#6946) · rectorphp/rector-src@66a7ba8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 66a7ba8

Browse files
authored
Bump to PHP-Parser ^5.5.0 (#6946)
1 parent f02a2f4 commit 66a7ba8

File tree

7 files changed

+27
-17
lines changed

7 files changed

+27
-17
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"doctrine/inflector": "^2.0.10",
2121
"illuminate/container": "^11.44",
2222
"nette/utils": "^4.0",
23-
"nikic/php-parser": "^5.4.0",
23+
"nikic/php-parser": "^5.5.0",
2424
"ocramius/package-versions": "^2.9",
2525
"ondram/ci-detector": "^4.2",
2626
"phpstan/phpdoc-parser": "^2.0.2",

rules-tests/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector/Fixture/do_not_remove_parameter_attribute.php.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromo
2424

2525
final class DoNotRemoveParameterAttribute
2626
{
27-
public function __construct(#[\SensitiveParameter]private string $password)
27+
public function __construct(
28+
#[\SensitiveParameter]private string $password
29+
)
2830
{
2931
}
3032
}

rules-tests/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector/Fixture/mix_non_attribute_and_attribute_property.php.inc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ use JetBrains\PhpStorm\Immutable;
3131

3232
final class MixNonAttributeAndAttributeProperty
3333
{
34-
public function __construct(#[Immutable]
35-
public float $latitude, public float $longitude)
34+
public function __construct(
35+
#[Immutable]
36+
public float $latitude,
37+
public float $longitude
38+
)
3639
{
3740
}
3841
}

rules-tests/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector/Fixture/property_with_attribute.php.inc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@ use JetBrains\PhpStorm\Immutable;
3636

3737
final class PropertyWithAttribute
3838
{
39-
public function __construct(#[Immutable]
40-
public float $latitude, #[Immutable]
41-
#[Deprecated]
42-
public float $longiture)
39+
public function __construct(
40+
#[Immutable]
41+
public float $latitude,
42+
#[Immutable]
43+
#[Deprecated]
44+
public float $longiture
45+
)
4346
{
4447
}
4548
}

rules-tests/Php81/Rector/ClassMethod/NewInInitializerRector/Fixture/property_with_attributes.php.inc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ use Symfony\Component\Uid\Ulid;
3131
#[ORM\Entity]
3232
class Carrier
3333
{
34-
public function __construct(#[ORM\Id]
35-
#[ORM\Column(type: 'ulid', unique: true)]
36-
private Ulid $id = new Ulid())
34+
public function __construct(
35+
#[ORM\Id]
36+
#[ORM\Column(type: 'ulid', unique: true)]
< D7AE /code>37+
private Ulid $id = new Ulid()
38+
)
3739
{
3840
}
3941
}

rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ private function isPrivateConstant(ClassConstFetch $classConstFetch, Class_ $cla
113113
return false;
114114
}
115115

116-
foreach ($class->getConstants() as $classConst) {
117-
if (! $this->isName($classConst, $constantName)) {
116+
foreach ($class->getConstants() as $constant) {
117+
if (! $this->isName($constant, $constantName)) {
118118
continue;
119119
}
120120

121-
return $classConst->isPrivate();
121+
return $constant->isPrivate();
122122
}
123123

124124
return false;

rules/CodingStyle/Rector/ClassConst/RemoveFinalFromConstRector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ public function refactor(Node $node): ?Node
6363
}
6464

6565
$hasChanged = false;
66-
foreach ($node->getConstants() as $classConst) {
67-
if (! $classConst->isFinal()) {
66+
foreach ($node->getConstants() as $constant) {
67+
if (! $constant->isFinal()) {
6868
continue;
6969
}
7070

71-
$this->visibilityManipulator->removeFinal($classConst);
71+
$this->visibilityManipulator->removeFinal($constant);
7272
$hasChanged = true;
7373
}
7474

0 commit comments

Comments
 (0)
0