From 3430887035b6443015d9923941aa41aa1374ad8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 19 Jan 2021 18:15:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Annotation/Annotation.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Annotation/Annotation.php b/Annotation/Annotation.php index 608c5d36..7c17999c 100644 --- a/Annotation/Annotation.php +++ b/Annotation/Annotation.php @@ -80,16 +80,11 @@ class Annotation extends Component $this->_annotations[$alias] = []; } foreach ($paths as $path) { + if (!str_contains('.php', $path)) { + continue; + } $explode = explode('/', $path); - $isPhp = strpos('.php', $path); - if ($isPhp === false) { - continue; - } - if (strlen($path) - 4 != $isPhp) { - continue; - } - $explode_pop = array_pop($explode); if (is_file($path)) { $explode_pop = str_replace('.php', '', $explode_pop);