Skip to content

Commit d753a63

Browse files
herndlmondrejmirtes
authored andcommitted
Adapt for latest phpstan
1 parent 2488d03 commit d753a63

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"require": {
99
"php": "^7.2 || ^8.0",
10-
"phpstan/phpstan": "^1.5.0"
10+
"phpstan/phpstan": "^1.6.3"
1111
},
1212
"require-dev": {
1313
"nikic/php-parser": "^4.13.0",

tests/Type/WebMozartAssert/ImpossibleCheckTypeMethodCallRuleTest.php

+6-10
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ public function testExtension(): void
4444
'Call to static method Webmozart\Assert\Assert::notInstanceOf() with WebmozartAssertImpossibleCheck\Bar and \'WebmozartAssertImpossibleCheck\\\Bar\' will always evaluate to false.',
4545
32,
4646
],
47+
[
48+
'Call to static method Webmozart\Assert\Assert::stringNotEmpty() with null will always evaluate to false.',
49+
41,
50+
],
4751
[
4852
'Call to static method Webmozart\Assert\Assert::stringNotEmpty() with non-empty-string will always evaluate to true.',
4953
44,
@@ -74,14 +78,14 @@ public function testEqNotEq(): void
7478
'Call to static method Webmozart\Assert\Assert::notEq() with stdClass and stdClass will always evaluate to false.',
7579
15,
7680
],
77-
/*[
81+
[
7882
'Call to static method Webmozart\Assert\Assert::eq() with 1 and \'1\' will always evaluate to true.',
7983
37,
8084
],
8185
[
8286
'Call to static method Webmozart\Assert\Assert::notEq() with 1 and \'1\' will always evaluate to false.',
8387
38,
84-
],*/
88+
],
8589
[
8690
'Call to static method Webmozart\Assert\Assert::eq() with 1 and true will always evaluate to true.',
8791
39,
@@ -130,14 +134,6 @@ public function testEqNotEq(): void
130134
'Call to static method Webmozart\Assert\Assert::notEq() with \'php\' and \'php\' will always evaluate to false.',
131135
51,
132136
],
133-
[
134-
'Call to static method Webmozart\Assert\Assert::eq() with stdClass and null will always evaluate to false.',
135-
61,
136-
],
137-
[
138-
'Call to static method Webmozart\Assert\Assert::notEq() with stdClass and null will always evaluate to true.',
139-
62,
140-
],
141137
]);
142138
}
143139

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

-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ public function instancesOfDifferentTypesAreNeverEqual(stdClass $a, stdClass $b,
5757
Assert::eq($b, self::createStdClass());
5858
Assert::notEq($c, new stdClass());
5959
Assert::notEq($d, self::createStdClass());
60-
61-
Assert::eq($e, null); // will always evaluate to false
62-
Assert::notEq($f, null); // will always evaluate to true
6360
}
6461

6562
public static function createStdClass(): stdClass

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function notInstanceOf(Bar $a): void
3838
*/
3939
public function stringNotEmpty(string $a, string $b, string $c, ?string $d, ?string $e): void
4040
{
41-
Assert::stringNotEmpty(null); // maybe this should report, similar as '' does too
41+
Assert::stringNotEmpty(null);
4242

4343
Assert::stringNotEmpty($a);
4444
Assert::stringNotEmpty($a);

0 commit comments

Comments
 (0)