Skip to content

Commit 4689037

Browse files
committed
fix tests
1 parent 83fc24b commit 4689037

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
@@ -840,6 +840,12 @@ parameters:
840840
count: 1
841841
path: src/Testing/RuleTestCase.php
842842

843+
-
844+
rawMessage: 'Parameter #1 $callback of function array_map expects Closure(string): mixed, array{PHPStan\File\FileHelper, ''normalizePath''} given.'
845+
identifier: argument.type
846+
count: 1
847+
path: src/Testing/RuleTestCase.php
848+
843849
-
844850
rawMessage: Access to constant on deprecated interface PHPStan\Type\FunctionParameterClosureTypeExtension.
845851
identifier: classConstant.deprecatedInterface
@@ -1554,6 +1560,18 @@ parameters:
15541560
count: 1
15551561
path: src/Type/IntersectionType.php
15561562

1563+
-
1564+
rawMessage: 'Parameter #1 $callback of function array_map expects Closure(PHPStan\Type\Type): mixed, callable(PHPStan\Type\Type): PHPStan\Type\Type given.'
1565+
identifier: argument.type
1566+
count: 1
1567+
path: src/Type/IntersectionType.php
1568+
1569+
-
1570+
rawMessage: 'Parameter #2 $callback of function array_filter expects Closure(PHPStan\Type\Type): bool, callable(PHPStan\Type\Type): bool given.'
1571+
identifier: argument.type
1572+
count: 1
1573+
path: src/Type/IntersectionType.php
1574+
15571575
-
15581576
rawMessage: Doing instanceof PHPStan\Type\IntersectionType is error-prone and deprecated.
15591577
identifier: phpstanApi.instanceofType
@@ -1632,12 +1650,36 @@ parameters:
16321650
count: 1
16331651
path: src/Type/PHPStan/ClassNameUsageLocationCreateIdentifierDynamicReturnTypeExtension.php
16341652

1653+
-
1654+
rawMessage: Class PHPStan\Type\Php\ArrayFilterParameterClosureTypeExtension implements deprecated interface PHPStan\Type\FunctionParameterClosureTypeExtension.
1655+
identifier: class.implementsDeprecatedInterface
1656+
count: 1
1657+
path: src/Type/Php/ArrayFilterParameterClosureTypeExtension.php
1658+
1659+
-
1660+
rawMessage: Class PHPStan\Type\Php\ArrayFindParameterClosureTypeExtension implements deprecated interface PHPStan\Type\FunctionParameterClosureTypeExtension.
1661+
identifier: class.implementsDeprecatedInterface
1662+
count: 1
1663+
path: src/Type/Php/ArrayFindParameterClosureTypeExtension.php
1664+
16351665
-
16361666
rawMessage: 'Doing instanceof PHPStan\Type\Constant\ConstantStringType is error-prone and deprecated. Use Type::getConstantStrings() instead.'
16371667
identifier: phpstanApi.instanceofType
16381668
count: 1
16391669
path: src/Type/Php/ArrayKeyExistsFunctionTypeSpecifyingExtension.php
16401670

1671+
-
1672+
rawMessage: Class PHPStan\Type\Php\ArrayMapParameterClosureTypeExtension implements deprecated interface PHPStan\Type\FunctionParameterClosureTypeExtension.
1673+
identifier: class.implementsDeprecatedInterface
1674+
count: 1
1675+
path: src/Type/Php/ArrayMapParameterClosureTypeExtension.php
1676+
1677+
-
1678+
rawMessage: Class PHPStan\Type\Php\ArrayWalkParameterClosureTypeExtension implements deprecated interface PHPStan\Type\FunctionParameterClosureTypeExtension.
1679+
identifier: class.implementsDeprecatedInterface
1680+
count: 1
1681+
path: src/Type/Php/ArrayWalkParameterClosureTypeExtension.php
1682+
16411683
-
16421684
rawMessage: 'Doing instanceof PHPStan\Type\ConstantScalarType is error-prone and deprecated. Use Type::isConstantScalarValue() or Type::getConstantScalarTypes() or Type::getConstantScalarValues() instead.'
16431685
identifier: phpstanApi.instanceofType
@@ -1674,6 +1716,12 @@ parameters:
16741716
count: 1
16751717
path: src/Type/Php/InArrayFunctionTypeSpecifyingExtension.php
16761718

1719+
-
1720+
rawMessage: 'Parameter #1 $callback of function array_map expects Closure(non-falsy-string): mixed, ''strtoupper'' given.'
1721+
identifier: argument.type
1722+
count: 1
1723+
path: src/Type/Php/MbStrlenFunctionReturnTypeExtension.php
1724+
16771725
-
16781726
rawMessage: 'Doing instanceof PHPStan\Type\Constant\ConstantStringType is error-prone and deprecated. Use Type::getConstantStrings() instead.'
16791727
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
@@ -744,19 +744,19 @@ public function testPregReplaceCallback(): void
744744
{
745745
$this->analyse([__DIR__ . '/data/preg_replace_callback.php'], [
746746
[
747-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(string): string given.',
747+
'Parameter #2 $callback of function preg_replace_callback expects Closure(array{non-falsy-string}): string, Closure(string): string given.',
748748
6,
749749
],
750750
[
751-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(string): string given.',
751+
'Parameter #2 $callback of function preg_replace_callback expects Closure(array{non-falsy-string}): string, Closure(string): string given.',
752752
13,
753753
],
754754
[
755-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(array): void given.',
755+
'Parameter #2 $callback of function preg_replace_callback expects Closure(array{non-falsy-string}): string, Closure(array): void given.',
756756
20,
757757
],
758758
[
759-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(): void given.',
759+
'Parameter #2 $callback of function preg_replace_callback expects Closure(array{non-falsy-string}): string, Closure(): void given.',
760760
25,
761761
],
762762
]);
@@ -2936,11 +2936,11 @@ public function testConstantParameterCheck(): void
29362936
110,
29372937
],
29382938
[
2939-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(mixed): array{non-falsy-string, int<-1, max>} given.',
2939+
'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.',
29402940
113,
29412941
],
29422942
[
2943-
'Parameter #2 $callback of function preg_replace_callback expects callable(array<string>): string, Closure(mixed): array{non-falsy-string|null, int<-1, max>} given.',
2943+
'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.',
29442944
116,
29452945
],
29462946
[

0 commit comments

Comments
 (0)