Skip to content

Commit

Permalink
fix: resolve issue with SpaceInGenericsFixer
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke committed Apr 16, 2024
1 parent c0f9f4c commit 4830cc0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/PhpCsFixer/SpaceInGenericsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ public function fix(SplFileInfo $file, Tokens $tokens): void
continue;
}

$type = $annotation->getTypeExpression()->toString();
$type = $this->fixType($type);
$typeExpression = $annotation->getTypeExpression();
if ($typeExpression === null) {
continue;
}

$type = $this->fixType($typeExpression->toString());
$annotation->setTypes([$type]);
}

Expand Down

0 comments on commit 4830cc0

Please sign in to comment.