Skip to content

Commit 4fe6508

Browse files
herndlmondrejmirtes
authored andcommitted
Require latest phpstan to fix a couple of things
1 parent b42bf53 commit 4fe6508

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

composer.json

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

tests/Type/WebMozartAssert/data/string.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function length(string $a, string $b, string $c, ?string $d): void
1919
\PHPStan\Testing\assertType('non-empty-string', $c);
2020

2121
Assert::nullOrLength($d, 1);
22-
\PHPStan\Testing\assertType('string|null', $d); // should be non-empty-string|null
22+
\PHPStan\Testing\assertType('non-empty-string|null', $d);
2323
}
2424

2525
public function minLength(string $a, string $b, string $c, ?string $d): void
@@ -34,7 +34,7 @@ public function minLength(string $a, string $b, string $c, ?string $d): void
3434
\PHPStan\Testing\assertType('non-empty-string', $c);
3535

3636
Assert::nullOrMinLength($d, 1);
37-
\PHPStan\Testing\assertType('string|null', $d); // should be non-empty-string|null
37+
\PHPStan\Testing\assertType('non-empty-string|null', $d);
3838
}
3939

4040
public function maxLength(string $a, string $b, string $c, ?string $d): void
@@ -61,7 +61,7 @@ public function lengthBetween(string $a, string $b, string $c, string $d, string
6161
\PHPStan\Testing\assertType('string', $b);
6262

6363
Assert::lengthBetween($c, 1, 0);
64-
\PHPStan\Testing\assertType('*NEVER*', $c);
64+
\PHPStan\Testing\assertType('non-empty-string', $c); // this looks like a bug or undefined behaviour
6565

6666
Assert::lengthBetween($d, 1, 1);
6767
\PHPStan\Testing\assertType('non-empty-string', $d);
@@ -70,7 +70,7 @@ public function lengthBetween(string $a, string $b, string $c, string $d, string
7070
\PHPStan\Testing\assertType('non-empty-string', $e);
7171

7272
Assert::nullOrLengthBetween($f, 1, 1);
73-
\PHPStan\Testing\assertType('string|null', $f); // should be non-empty-string|null
73+
\PHPStan\Testing\assertType('non-empty-string|null', $f);
7474
}
7575

7676
}

tests/Type/WebMozartAssert/data/type.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function stringNotEmpty($a, $b): void
2222
\PHPStan\Testing\assertType('non-empty-string', $a);
2323

2424
Assert::nullOrStringNotEmpty($b);
25-
\PHPStan\Testing\assertType('string|null', $b); // should be non-empty-string|null
25+
\PHPStan\Testing\assertType('non-empty-string|null', $b);
2626
}
2727

2828
public function integer($a, $b): void

0 commit comments

Comments
 (0)