gen_stub: avoid unneeded regex match

This commit is contained in:
Daniel Scherzer 2025-05-15 15:03:04 -04:00
parent ecc403a8fa
commit 5ae87ffef4

View file

@ -54,7 +54,7 @@ function processDirectory(string $dir, Context $context): array {
);
foreach ($it as $file) {
$pathName = $file->getPathName();
if (preg_match('/\.stub\.php$/', $pathName)) {
if (substr($pathName, -9) === '.stub.php') {
$pathNames[] = $pathName;
}
}