Skip to content

Commit

Permalink
Merge branch 'feature/generic-lowercasetype-union-types-php8' of http…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Nov 2, 2020
2 parents 0277ae1 + d1fdf32 commit b8c5436
Show file tree
Hide file tree
Showing 5 changed files with 295 additions and 110 deletions.
49 changes: 27 additions & 22 deletions src/Files/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -1556,17 +1556,19 @@ public function getMethodParameters($stackPtr)
* The format of the return value is:
* <code>
* array(
* 'scope' => 'public', // Public, private, or protected
* 'scope_specified' => true, // TRUE if the scope keyword was found.
* 'return_type' => '', // The return type of the method.
* 'return_type_token' => integer, // The stack pointer to the start of the return type
* // or FALSE if there is no return type.
* 'nullable_return_type' => false, // TRUE if the return type is preceded by the
* // nullability operator.
* 'is_abstract' => false, // TRUE if the abstract keyword was found.
* 'is_final' => false, // TRUE if the final keyword was found.
* 'is_static' => false, // TRUE if the static keyword was found.
* 'has_body' => false, // TRUE if the method has a body
* 'scope' => 'public', // Public, private, or protected
* 'scope_specified' => true, // TRUE if the scope keyword was found.
* 'return_type' => '', // The return type of the method.
* 'return_type_token' => integer, // The stack pointer to the start of the return type
* // or FALSE if there is no return type.
* 'return_type_end_token' => integer, // The stack pointer to the end of the return type
* // or FALSE if there is no return type.
* 'nullable_return_type' => false, // TRUE if the return type is preceded by the
* // nullability operator.
* 'is_abstract' => false, // TRUE if the abstract keyword was found.
* 'is_final' => false, // TRUE if the final keyword was found.
* 'is_static' => false, // TRUE if the static keyword was found.
* 'has_body' => false, // TRUE if the method has a body
* );
* </code>
*
Expand Down Expand Up @@ -1645,6 +1647,7 @@ public function getMethodProperties($stackPtr)

$returnType = '';
$returnTypeToken = false;
$returnTypeEndToken = false;
$nullableReturnType = false;
$hasBody = true;

Expand Down Expand Up @@ -1684,9 +1687,10 @@ public function getMethodProperties($stackPtr)
$returnTypeToken = $i;
}

$returnType .= $this->tokens[$i]['content'];
$returnType .= $this->tokens[$i]['content'];
$returnTypeEndToken = $i;
}
}
}//end for

if ($this->tokens[$stackPtr]['code'] === T_FN) {
$bodyToken = T_FN_ARROW;
Expand All @@ -1703,15 +1707,16 @@ public function getMethodProperties($stackPtr)
}

return [
'scope' => $scope,
'scope_specified' => $scopeSpecified,
'return_type' => $returnType,
'return_type_token' => $returnTypeToken,
'nullable_return_type' => $nullableReturnType,
'is_abstract' => $isAbstract,
'is_final' => $isFinal,
'is_static' => $isStatic,
'has_body' => $hasBody,
'scope' => $scope,
'scope_specified' => $scopeSpecified,
'return_type' => $returnType,
'return_type_token' => $returnTypeToken,
'return_type_end_token' => $returnTypeEndToken,
'nullable_return_type' => $nullableReturnType,
'is_abstract' => $isAbstract,
'is_final' => $isFinal,
'is_static' => $isStatic,
'has_body' => $hasBody,
];

}//end getMethodProperties()
Expand Down
Loading

0 comments on commit b8c5436

Please sign in to comment.