1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Add nullable type

This commit is contained in:
Matthew Brown 2020-05-22 13:18:18 -04:00 committed by GitHub
parent bebfac0ab6
commit 4f33330215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -481,7 +481,7 @@ class ConditionalReturnTypeTest extends TestCase
/**
* @psalm-return ($name is "foo" ? string : null)
*/
function get(string $name) {
function get(string $name) : ?string {
if ($name === "foo") {
return "hello";
}