From 5fa3585934795df256ccaa3177fb6f70394a25df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=9E=9C=E7=9A=84=E5=A6=82=E6=9E=9C?= Date: Fri, 3 Jul 2020 10:24:18 +0800 Subject: [PATCH] fix parser file class --- src/Annotation/Parser.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Annotation/Parser.php b/src/Annotation/Parser.php index cf0a374..0ed4c66 100644 --- a/src/Annotation/Parser.php +++ b/src/Annotation/Parser.php @@ -549,8 +549,11 @@ public static function getFileDeclareClass(string $file): ?string for ($j = $i + 1; $j < count($tokens); $j++) { if ($tokens[$j] === '{') { $class = $tokens[$i + 2][1]; + break; } } + }elseif ($class){ + break; } } if (!empty($class)) {