Skip to content

Commit

Permalink
Allow the return type checks to run with php 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
othercorey committed Jun 26, 2022
1 parent a47b773 commit c93deff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/Internal/Codebase/InternalCallMapHandlerTest.php
Expand Up @@ -765,7 +765,11 @@ private function assertParameter(array $normalizedEntry, ReflectionParameter $pa
*/
public function assertEntryReturnType(ReflectionFunction $function, string $entryReturnType): void
{
$expectedType = $function->hasTentativeReturnType() ? $function->getTentativeReturnType() : $function->getReturnType();
if (version_compare(PHP_VERSION, '8.1.0', '>=')) {
$expectedType = $function->hasTentativeReturnType() ? $function->getTentativeReturnType() : $function->getReturnType();
} else {
$expectedType = $function->getReturnType();
}
if ($expectedType === null) {
$this->assertSame('', $entryReturnType, 'CallMap entry has incorrect return type');
return;
Expand Down

0 comments on commit c93deff

Please sign in to comment.