Skip to content

Commit 24d01e9

Browse files
committed
fix tests
1 parent 47f174d commit 24d01e9

7 files changed

Lines changed: 59 additions & 11 deletions

‎phpstan-baseline.neon‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,12 @@ parameters:
846846
count: 1
847847
path: src/Testing/RuleTestCase.php
848848

849+
-
850+
rawMessage: 'Parameter #1 $callback of function array_map expects Closure(string): mixed, array{PHPStan\File\FileHelper, ''normalizePath''} given.'
851+
identifier: argument.type
852+
count: 1
853+
path: src/Testing/RuleTestCase.php
854+
849855
-
850856
rawMessage: Access to constant on deprecated interface PHPStan\Type\FunctionParameterClosureTypeExtension.
851857
identifier: classConstant.deprecatedInterface
@@ -1560,6 +1566,18 @@ parameters:
15601566
count: 1
15611567
path: src/Type/IntersectionType.php
15621568

1569+
-
1570+
rawMessage: 'Parameter #1 $callback of function array_map expects Closure(PHPStan\Type\Type): mixed, callable(PHPStan\Type\Type): PHPStan\Type\Type given.'
1571+
identifier: argument.type
1572+
count: 1
1573+
path: src/Type/IntersectionType.php
1574+
1575+
-
1576+
rawMessage: 'Parameter #2 $callback of function array_filter expects Closure(PHPStan\Type\Type): bool, callable(PHPStan\Type\Type): bool given.'
1577+
identifier: argument.type
1578+
count: 1
1579+
path: src/Type/IntersectionType.php
1580+
15631581
-
15641582
rawMessage: Doing instanceof PHPStan\Type\IntersectionType is error-prone and deprecated.
15651583
identifier: phpstanApi.instanceofType
@@ -1638,12 +1656,36 @@ parameters:
16381656
count: 1
16391657
path: src/Type/PHPStan/ClassNameUsageLocationCreateIdentifierDynamicReturnTypeExtension.php
16401658

1659+
-
1660+
rawMessage: Class PHPStan\Type\Php\ArrayFilterParameterClosureTypeExtension implements deprecated interface PHPStan\Type\FunctionParameterClosureTypeExtension.
1661+
identifier: class.implementsDeprecatedInterface
1662+
count: 1
1663+
path: src/Type/Php/ArrayFilterParameterClosureTypeExtension.php
1664+
1665+
-
1666+
rawMessage: Class PHPStan\Type\Php\ArrayFindParameterClosureTypeExtension implements deprecated interface PHPStan\Type\FunctionParameterClosureTypeExtension.
1667+
identifier: class.implementsDeprecatedInterface
1668+
count: 1
1669+
path: src/Type/Php/ArrayFindParameterClosureTypeExtension.php
1670+
16411671
-
16421672
rawMessage: 'Doing instanceof PHPStan\Type\Constant\ConstantStringType is error-prone and deprecated. Use Type::getConstantStrings() instead.'
16431673
identifier: phpstanApi.instanceofType
16441674
count: 1
16451675
path: src/Type/Php/ArrayKeyExistsFunctionTypeSpecifyingExtension.php
16461676

1677+
-
1678+
rawMessage: Class PHPStan\Type\Php\ArrayMapParameterClosureTypeExtension implements deprecated interface PHPStan\Type\FunctionParameterClosureTypeExtension.
1679+
identifier: class.implementsDeprecatedInterface
1680+
count: 1
1681+
path: src/Type/Php/ArrayMapParameterClosureTypeExtension.php
1682+
1683+
-
1684+
rawMessage: Class PHPStan\Type\Php\ArrayWalkParameterClosureTypeExtension implements deprecated interface PHPStan\Type\FunctionParameterClosureTypeExtension.
1685+
identifier: class.implementsDeprecatedInterface
1686+
count: 1
1687+
path: src/Type/Php/ArrayWalkParameterClosureTypeExtension.php
1688+
16471689
-
16481690
rawMessage: 'Doing instanceof PHPStan\Type\ConstantScalarType is error-prone and deprecated. Use Type::isConstantScalarValue() or Type::getConstantScalarTypes() or Type::getConstantScalarValues() instead.'
16491691
identifier: phpstanApi.instanceofType
@@ -1680,6 +1722,12 @@ parameters:
16801722
count: 1
16811723
path: src/Type/Php/InArrayFunctionTypeSpecifyingExtension.php
16821724

1725+
-
1726+
rawMessage: 'Parameter #1 $callback of function array_map expects Closure(non-falsy-string): mixed, ''strtoupper'' given.'
1727+
identifier: argument.type
1728+
count: 1
1729+
path: src/Type/Php/MbStrlenFunctionReturnTypeExtension.php
1730+
16831731
-
16841732
rawMessage: 'Doing instanceof PHPStan\Type\Constant\ConstantStringType is error-prone and deprecated. Use Type::getConstantStrings() instead.'
16851733
identifier: phpstanApi.instanceofType

‎tests/PHPStan/Analyser/DynamicParameterTypeExtensionArraysTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use PHPUnit\Framework\Attributes\DataProvider;
77
use PHPUnit\Framework\Attributes\RequiresPhp;
88

9-
#[RequiresPhp('>= 8.0')]
9+
#[RequiresPhp('>= 8.0.0')]
1010
class DynamicParameterTypeExtensionArraysTest extends TypeInferenceTestCase
1111
{
1212

‎tests/PHPStan/Analyser/DynamicParameterTypeExtensionClosuresTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use PHPUnit\Framework\Attributes\DataProvider;
77
use PHPUnit\Framework\Attributes\RequiresPhp;
88

9-
#[RequiresPhp('>= 8.0')]
9+
#[RequiresPhp('>= 8.0.0')]
1010
class DynamicParameterTypeExtensionClosuresTest extends TypeInferenceTestCase
1111
{
1212

‎tests/PHPStan/Analyser/data/dynamic-parameter-type-extension-arrays.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php // lint >= 8.0
22

33
namespace DynamicParameterTypeExtensionArrays;
44

‎tests/PHPStan/Analyser/data/dynamic-parameter-type-extension-closures-errors.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php // lint >= 8.0
22

33
namespace DynamicParameterTypeExtensionClosuresErrors;
44

‎tests/PHPStan/Analyser/data/dynamic-parameter-type-extension-closures.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php // lint >= 8.0
22

33
namespace DynamicParameterTypeExtensionClosures;
44

‎tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -746,19 +746,19 @@ public function testPregReplaceCallback(): void
746746
{
747747
$this->analyse([__DIR__ . '/data/preg_replace_callback.php'], [
748748
[
749-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(string): string given.',
749+
'Parameter #2 $callback of function preg_replace_callback expects Closure(array{non-falsy-string}): string, Closure(string): string given.',
750750
6,
751751
],
752752
[
753-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(string): string given.',
753+
'Parameter #2 $callback of function preg_replace_callback expects Closure(array{non-falsy-string}): string, Closure(string): string given.',
754754
13,
755755
],
756756
[
757-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(array): void given.',
757+
'Parameter #2 $callback of function preg_replace_callback expects Closure(array{non-falsy-string}): string, Closure(array): void given.',
758758
20,
759759
],
760760
[
761-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(): void given.',
761+
'Parameter #2 $callback of function preg_replace_callback expects Closure(array{non-falsy-string}): string, Closure(): void given.',
762762
25,
763763
],
764764
]);
@@ -2938,11 +2938,11 @@ public function testConstantParameterCheck(): void
29382938
110,
29392939
],
29402940
[
2941-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(mixed): array{non-falsy-string, int<-1, max>} given.',
2941+
'Parameter #2 $callback of function preg_replace_callback expects Closure(array{array{non-falsy-string, int<-1, max>}}): string, Closure(mixed): array{non-falsy-string, int<-1, max>} given.',
29422942
113,
29432943
],
29442944
[
2945-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(mixed): array{non-falsy-string|null, int<-1, max>} given.',
2945+
'Parameter #2 $callback of function preg_replace_callback expects Closure(array{array{non-falsy-string|null, int<-1, max>}}): string, Closure(mixed): array{non-falsy-string|null, int<-1, max>} given.',
29462946
116,
29472947
],
29482948
[

0 commit comments

Comments
 (0)