Skip to content

Commit

Permalink
Fix regression fetching violations when the list is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed May 31, 2024
1 parent 5bb7f1e commit acd2279
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ClassMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public function getMap(): array
*/
public function getPsrViolations(): array
{
if (\count($this->psrViolations) === 0) {
return [];
}

return array_map(static function (array $violation): string {
return $violation['warning'];
}, array_merge(...array_values($this->psrViolations)));
Expand Down

0 comments on commit acd2279

Please sign in to comment.