From 90421983d95553e503caed3cafdcc69847e66e70 Mon Sep 17 00:00:00 2001 From: ssnepenthe Date: Mon, 1 Dec 2025 12:48:30 -0700 Subject: [PATCH] Fix always-false conditional `$matches` is `[[]]` when pattern is not matched, something like `[['class ']]` otherwise --- src/PhpFileParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpFileParser.php b/src/PhpFileParser.php index 27fc690..04d9828 100644 --- a/src/PhpFileParser.php +++ b/src/PhpFileParser.php @@ -60,7 +60,7 @@ public static function findClasses(string $path): array // return early if there is no chance of matching anything in this file Preg::matchAllStrictGroups('{\b(?:class|interface|trait'.$extraTypes.')\s}i', $contents, $matches); - if ([] === $matches) { + if ([] === $matches[0]) { return []; }