Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed May 31, 2024
1 parent f7f434d commit 4deaf64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/Type/Php/ConstantFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ public function getTypeFromFunctionCall(

$results = [];
foreach ($nameType->getConstantStrings() as $constantName) {
if ($constantName->getValue() === '') {
return null;
}

$expr = $this->constantHelper->createExprFromConstantName($constantName->getValue());
if ($expr === null) {
return new ErrorType();
Expand Down
7 changes: 4 additions & 3 deletions src/Type/Php/ConstantHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
class ConstantHelper
{

/**
* @param non-empty-string $constantName
*/
public function createExprFromConstantName(string $constantName): ?Expr
{
if ($constantName === '') {
return null;
}

$classConstParts = explode('::', $constantName);
if (count($classConstParts) >= 2) {
$fqcn = ltrim($classConstParts[0], '\\');
Expand Down

0 comments on commit 4deaf64

Please sign in to comment.