Skip to content

Commit

Permalink
chore: NoSuperfluousPhpdocTagsFixer - no need to call heavy toCompara…
Browse files Browse the repository at this point in the history
…bleNames method to add null type (#8132)
  • Loading branch information
keradus authored Jul 24, 2024
1 parent 2aa85ee commit 7d15b94
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,10 @@ private function annotationIsSuperfluous(

// retry comparison with annotation type unioned with null
// phpstan implies the null presence from the native type
return $actualTypes === $this->toComparableNames(array_merge($annotationTypes, ['null']), null, null, []);
$annotationTypes = array_merge($annotationTypes, ['null']);
sort($annotationTypes);

return $actualTypes === $annotationTypes;
}

/**
Expand Down

0 comments on commit 7d15b94

Please sign in to comment.