Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require latest phpstan to fix a couple of things #102

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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