Skip to content

Commit 1de17f9

Browse files
committed
cs
1 parent d051cbe commit 1de17f9

File tree

15 files changed

+40
-129
lines changed

15 files changed

+40
-129
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"phpunit/phpunit": "^11.5",
1414
"rector/rector-src": "dev-main",
1515
"symplify/easy-coding-standard": "^12.3",
16+
"symplify/phpstan-rules": "^14.9",
1617
"symplify/rule-doc-generator": "^12.2",
1718
"symplify/vendor-patches": "^11.5",
1819
"tomasvotruba/class-leak": "^1.0",

phpstan.neon

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# to be enabled later once rector upgraded to use phpstan v2
2-
# includes:
3-
# - vendor/symplify/phpstan-rules/config/symplify-rules.neon
4-
# - vendor/symplify/phpstan-rules/config/rector-rules.neon
1+
includes:
2+
- vendor/symplify/phpstan-rules/config/symplify-rules.neon
3+
- vendor/symplify/phpstan-rules/config/rector-rules.neon
54

65
parameters:
76
level: 8
@@ -57,16 +56,16 @@ parameters:
5756
- '#Doing instanceof PHPStan\\Type\\.+ is error\-prone and deprecated#'
5857

5958
# phpstan instanceof
60-
-
61-
identifier: phpstanApi.instanceofAssumption
62-
63-
-
64-
identifier: phpstanApi.varTagAssumption
59+
- identifier: phpstanApi.instanceofAssumption
60+
- identifier: phpstanApi.varTagAssumption
61+
- '#Asking about instanceof PHPStan\\.* is not covered by backward compatibility promise#'
6562

6663
-
6764
identifier: argument.type
68-
69-
- '#Asking about instanceof PHPStan\\.* is not covered by backward compatibility promise#'
65+
paths:
66+
- rules/DowngradePhp85/Rector/StmtsAwareInterface/DowngradePipeOperatorRector.php
67+
- rules/DowngradePhp85/Rector/Class_/DowngradeFinalPropertyPromotionRector.php
68+
- rules/DowngradePhp80/Rector/New_/DowngradeArbitraryExpressionsSupportRector.php
7069

7170
# false positive intanceof in OR usage
7271
-

rules-tests/DowngradePhp81/Rector/FuncCall/DowngradeHashAlgorithmXxHash/Fixture/fixture_constant.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Rector\Tests\DowngradePhp81\Rector\FuncCall\DowngradeHashAlgorithmXxHash\Fixture;
44

5-
class Fixture
5+
final class FixtureConstant
66
{
77
public function run()
88
{
@@ -16,7 +16,7 @@ class Fixture
1616

1717
namespace Rector\Tests\DowngradePhp81\Rector\FuncCall\DowngradeHashAlgorithmXxHash\Fixture;
1818

19-
class Fixture
19+
final class FixtureConstant
2020
{
2121
public function run()
2222
{

rules-tests/DowngradePhp81/Rector/FuncCall/DowngradeHashAlgorithmXxHash/Fixture/fixture_named_arguments.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Rector\Tests\DowngradePhp81\Rector\FuncCall\DowngradeHashAlgorithmXxHash\Fixture;
44

5-
class Fixture
5+
final class FixtureNamedArguments
66
{
77
public function run()
88
{
@@ -16,7 +16,7 @@ class Fixture
1616

1717
namespace Rector\Tests\DowngradePhp81\Rector\FuncCall\DowngradeHashAlgorithmXxHash\Fixture;
1818

19-
class Fixture
19+
final class FixtureNamedArguments
2020
{
2121
public function run()
2222
{

rules-tests/DowngradePhp81/Rector/FuncCall/DowngradeHashAlgorithmXxHash/Fixture/fixture_named_arguments_false_order.php.inc

Lines changed: 0 additions & 27 deletions
This file was deleted.

rules-tests/DowngradePhp81/Rector/FuncCall/DowngradeHashAlgorithmXxHash/Fixture/fixture_xxh128.php.inc

Lines changed: 0 additions & 27 deletions
This file was deleted.

rules-tests/DowngradePhp81/Rector/FuncCall/DowngradeHashAlgorithmXxHash/Fixture/fixture_xxh32.php.inc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
namespace Rector\Tests\DowngradePhp81\Rector\FuncCall\DowngradeHashAlgorithmXxHash\Fixture;
44

5-
class Fixture
5+
final class FixtureXxh32
66
{
77
public function run()
88
{
9-
return hash('xxh32', 'some-data-to-hash');
9+
$value = hash('xxh32', 'some-data-to-hash');
10+
11+
$value = hash('xxh64', 'some-data-to-hash');
12+
13+
$value = hash('xxh128', 'some-data-to-hash');
1014
}
1115
}
1216

@@ -16,11 +20,15 @@ class Fixture
1620

1721
namespace Rector\Tests\DowngradePhp81\Rector\FuncCall\DowngradeHashAlgorithmXxHash\Fixture;
1822

19-
class Fixture
23+
final class FixtureXxh32
2024
{
2125
public function run()
2226
{
23-
return hash('md5', 'some-data-to-hash');
27+
$value = hash('md5', 'some-data-to-hash');
28+
29+
$value = hash('md5', 'some-data-to-hash');
30+
31+
$value = hash('md5', 'some-data-to-hash');
2432
}
2533
}
2634

rules-tests/DowngradePhp81/Rector/FuncCall/DowngradeHashAlgorithmXxHash/Fixture/fixture_xxh64.php.inc

Lines changed: 0 additions & 27 deletions
This file was deleted.

rules-tests/DowngradePhp81/Rector/FuncCall/DowngradeHashAlgorithmXxHash/Fixture/skip_check_version_compare_ternary.php.inc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ final class SkipCheckVersionCompareTernary
66
{
77
public function run_v()
88
{
9-
return version_compare(PHP_VERSION, '8.1','>=')
9+
$value = version_compare(PHP_VERSION, '8.1','>=')
1010
? hash( 'xxh128', $value )
1111
: hash( 'md4', $value );
12+
13+
$value = version_compare(PHP_VERSION, '8.1','<')
14+
? hash( 'md4', $value )
15+
: hash( 'xxh128', $value );
1216
}
1317
}

rules-tests/DowngradePhp81/Rector/FuncCall/DowngradeHashAlgorithmXxHash/Fixture/skip_check_version_compare_ternary2.php.inc

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)