-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed mixed type not considered nullable
- Loading branch information
1 parent
3d2e1db
commit c0aad86
Showing
4 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Bug6239; | ||
|
||
use function PHPStan\Testing\assertNativeType; | ||
use function PHPStan\Testing\assertType; | ||
|
||
class UnionWithNullFails | ||
{ | ||
/** | ||
* @param int|null|bool $value | ||
*/ | ||
public function withPhpDoc(mixed $value): void | ||
{ | ||
assertType('bool|int|null', $value); | ||
assertNativeType('mixed', $value); | ||
} | ||
|
||
public function doFoo(): void | ||
{ | ||
$this->withPhpDoc(null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters