Skip to content

Commit 009a5e4

Browse files
authored
Bump to PHPStan ^2.2.6 and Fix its Container compatibility in RichParser (#8208)
* Bump to PHPStan ^2.2.6 and Fix its Container compatibility in RichParser * Fix * fix tests * fix test * fix test
1 parent e3564ee commit 009a5e4

14 files changed

Lines changed: 32 additions & 39 deletions

File tree

‎build/target-repository/composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
],
1010
"require": {
1111
"php": "^7.4|^8.0",
12-
"phpstan/phpstan": "^2.2.2"
12+
"phpstan/phpstan": "^2.2.6"
1313
},
1414
"autoload": {
1515
"files": [

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"nikic/php-parser": "^5.8",
2424
"ondram/ci-detector": "^4.2",
2525
"phpstan/phpdoc-parser": "^2.3.3",
26-
"phpstan/phpstan": "^2.2.2",
26+
"phpstan/phpstan": "^2.2.6",
2727
"react/event-loop": "^1.6",
2828
"react/promise": "^3.3",
2929
"react/socket": "^1.17",

‎rules-tests/CodeQuality/Rector/Class_/CompleteDynamicPropertiesRector/FixtureUnionTypes/multiple_types.php.inc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Rector\Tests\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector
2323
class MultipleTypes
2424
{
2525
/**
26-
* @var bool|int|string
26+
* @var int|string|bool
2727
*/
2828
public $value;
2929
public function set()

‎rules-tests/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector/Fixture/final_class.php.inc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRec
4848

4949
final class FinalClass
5050
{
51-
public function getData(): int|string
51+
public function getData(): string|int
5252
{
5353
if (rand(0, 1)) {
5454
return 'text';

‎rules-tests/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector/Fixture/phpdocs.php.inc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\So
66

77
final class PhpDocs
88
{
9-
/** @return string|int|float */
9+
/** @return string|int */
1010
public function foo(): string|int|float
1111
{
1212
if (rand(0, 1)) {
@@ -71,7 +71,7 @@ use Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\So
7171

7272
final class PhpDocs
7373
{
74-
/** @return int|string */
74+
/** @return string|int */
7575
public function foo(): string|int
7676
{
7777
if (rand(0, 1)) {

‎rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector/FixturePhp80/pathinfo_return.php.inc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class PathInfoReturn
3636
*
3737
* @psalm-assert-if-true =non-empty-string $filename
3838
*/
39-
public static function extension($filename): array|string
39+
public static function extension($filename): string|array
4040
{
4141
return pathinfo($filename, PATHINFO_EXTENSION);
4242
}

‎rules-tests/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeForArrayMapRector/Fixture/fixture.php.inc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Fixture
8989
*/
9090
public function runThree(array $array, array $arrayTwo)
9191
{
92-
return array_map(function (string $value, \Rector\Tests\TypeDeclaration\Rector\FunctionLike\AddClosureParamTypeForArrayMapRector\Source\Bar|\Rector\Tests\TypeDeclaration\Rector\FunctionLike\AddClosureParamTypeForArrayMapRector\Source\Foo $second) {
92+
return array_map(function (string $value, \Rector\Tests\TypeDeclaration\Rector\FunctionLike\AddClosureParamTypeForArrayMapRector\Source\Foo|\Rector\Tests\TypeDeclaration\Rector\FunctionLike\AddClosureParamTypeForArrayMapRector\Source\Bar $second) {
9393
return get_class($second) . $value;
9494
}, $array, $arrayTwo);
9595
}

‎rules-tests/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeForArrayReduceRector/Fixture/fixture.php.inc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Fixture
4848
*/
4949
public function runTwo(array $array)
5050
{
51-
return array_reduce($array, function (int|string $carry, int|string $value) {
51+
return array_reduce($array, function (int|string $carry, string|int $value) {
5252
return $carry . $value;
5353
}, 100);
5454
}

‎rules-tests/TypeDeclarationDocblocks/Rector/ClassMethod/DocblockReturnArrayFromDirectArrayInstanceRector/Fixture/Nesting/complex_array.php.inc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\DocblockRetur
3636
class ComplexArray
3737
{
3838
/**
39-
* @return array<string, array<string, array<string, string>|int>|array<string, int|string>|bool>
39+
* @return array<string, array<string, int|array<string, string>>|array<string, string|int>|bool>
4040
*/
4141
public function run(): array
4242
{

‎rules-tests/TypeDeclarationDocblocks/Rector/ClassMethod/DocblockReturnArrayFromDirectArrayInstanceRector/Fixture/covert-implicit-key.php.inc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\DocblockRetur
2828
final class CoverImplicitKey
2929
{
3030
/**
31-
* @return array<int, array<string, int|string>>
31+
* @return array<int, array<string, string|int>>
3232
*/
3333
private static function getExpectedAllOwners(): array
3434
{

0 commit comments

Comments
 (0)