Skip to content

Commit

Permalink
Merge branch 'php-8.0/psr12-nullabletype-allow-for-static-returntype'…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Aug 31, 2020
2 parents c7b6dac + 945ea76 commit ad51b46
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class NullableTypeDeclarationSniff implements Sniff
T_CALLABLE => true,
T_SELF => true,
T_PARENT => true,
T_STATIC => true,
];


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ class testInstanceOf() {
$bal = $value instanceof static ? CONSTANT_NAME : $value;
}
}

// PHP 8.0: static return type.
function testStatic() : ? static {}
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ class testInstanceOf() {
$bal = $value instanceof static ? CONSTANT_NAME : $value;
}
}

// PHP 8.0: static return type.
function testStatic() : ?static {}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ protected function getErrorList()
57 => 2,
58 => 2,
59 => 2,
87 => 1,
];

}//end getErrorList()
Expand Down

0 comments on commit ad51b46

Please sign in to comment.