Skip to content

Commit

Permalink
Require latest phpstan to fix a couple of things
Browse files Browse the repository at this point in the history
  • Loading branch information
herndlm authored and ondrejmirtes committed Feb 15, 2022
1 parent b42bf53 commit 4fe6508
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"require": {
"php": "^7.1 || ^8.0",
"phpstan/phpstan": "^1.0"
"phpstan/phpstan": "^1.4.7"
},
"require-dev": {
"nikic/php-parser": "^4.13.0",
Expand Down
8 changes: 4 additions & 4 deletions tests/Type/WebMozartAssert/data/string.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function length(string $a, string $b, string $c, ?string $d): void
\PHPStan\Testing\assertType('non-empty-string', $c);

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

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

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

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

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

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

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

}
2 changes: 1 addition & 1 deletion tests/Type/WebMozartAssert/data/type.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function stringNotEmpty($a, $b): void
\PHPStan\Testing\assertType('non-empty-string', $a);

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

public function integer($a, $b): void
Expand Down

0 comments on commit 4fe6508

Please sign in to comment.