Skip to content

Commit

Permalink
Do stricter array_filter checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed May 3, 2024
1 parent a96c53d commit a5758da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/PhpFileParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ private static function getExtraTypes(): string
$extraTypes .= '|enum';
}

PhpFileCleaner::setTypeConfig(array_merge(['class', 'interface', 'trait'], array_filter(explode('|', $extraTypes))));
$extraTypesArray = array_filter(explode('|', $extraTypes), function (string $type) {
return $type !== '';
});
PhpFileCleaner::setTypeConfig(array_merge(['class', 'interface', 'trait'], $extraTypesArray));
}

return $extraTypes;
Expand Down

0 comments on commit a5758da

Please sign in to comment.