Skip to content

Commit fbdecd5

Browse files
Fix Ci after PR Phpstan#4472 (#208)
1 parent 578853e commit fbdecd5

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"keywords": ["static analysis"],
99
"require": {
1010
"php": "^7.4 || ^8.0",
11-
"phpstan/phpstan": "^2.1.7"
11+
"phpstan/phpstan": "^2.1.41"
1212
},
1313
"require-dev": {
1414
"nikic/php-parser": "^5.1",

tests/Type/WebMozartAssert/ImpossibleCheckTypeMethodCallRuleTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public function testExtension(): void
9191
'Call to static method Webmozart\Assert\Assert::allContains() with array<non-empty-string> and \'foo\' will always evaluate to true.',
9292
98,
9393
],
94+
/*
9495
[
9596
'Call to static method Webmozart\Assert\Assert::implementsInterface() with class-string<WebmozartAssertImpossibleCheck\Bar>|WebmozartAssertImpossibleCheck\Bar and \'WebmozartAssertImpossibleCheck\\\Bar\' will always evaluate to true.',
9697
105,
@@ -101,6 +102,7 @@ public function testExtension(): void
101102
108,
102103
$tipText,
103104
],
105+
*/
104106
[
105107
'Call to static method Webmozart\Assert\Assert::implementsInterface() with mixed and \'WebmozartAssertImpossibleCheck\\\Foo\' will always evaluate to false.',
106108
111,
@@ -114,6 +116,11 @@ public function testExtension(): void
114116
'Call to static method Webmozart\Assert\Assert::startsWith() with \'value\' and string will always evaluate to true.',
115117
126,
116118
],
119+
[
120+
'Call to static method Webmozart\Assert\Assert::implementsInterface() with \'WebmozartAssertImpossibleCheck\\\\Bar\' and \'WebmozartAssertImpossibleCheck\\\\Bar\' will always evaluate to false.',
121+
134,
122+
$tipText,
123+
],
117124
]);
118125
}
119126

tests/Type/WebMozartAssert/data/impossible-check.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ public function nonEmptyStringAndSomethingUnknownNarrow($a, string $b, array $c,
102102
public function implementsInterface($a, string $b, $c): void
103103
{
104104
Assert::implementsInterface($a, Bar::class);
105-
Assert::implementsInterface($a, Bar::class);
105+
Assert::implementsInterface($a, Bar::class); // Could be reported as always true
106106

107107
Assert::implementsInterface($b, Bar::class);
108-
Assert::implementsInterface($b, Bar::class);
108+
Assert::implementsInterface($b, Bar::class); // Could be reported as always true
109109

110110
Assert::implementsInterface($c, Unknown::class);
111111
Assert::implementsInterface($c, self::class);
@@ -127,6 +127,13 @@ public function testStartsWith(string $a): void
127127
Assert::startsWith("value", "bix");
128128
}
129129

130+
/** @param class-string<Bar> $a */
131+
public function implementsInterface2(string $a): void
132+
{
133+
Assert::implementsInterface($a, Bar::class);
134+
Assert::implementsInterface(Bar::class, Bar::class);
135+
}
136+
130137
}
131138

132139
interface Bar {};

0 commit comments

Comments
 (0)