From 7b5b21b3059c4d9e5b1c86368e1814896cf25e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 24 Apr 2023 22:31:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inject/Skip.php | 10 ++++++++++ Scanner.php | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 Inject/Skip.php diff --git a/Inject/Skip.php b/Inject/Skip.php new file mode 100644 index 0000000..9fe78aa --- /dev/null +++ b/Inject/Skip.php @@ -0,0 +1,10 @@ +files as $file) { $class = $this->rename($file); - if (file_exists($class)) { + if (!class_exists($class)) { error('Please follow the PSR-4 specification to write code.' . $class); continue; } + $reflect = $container->getReflectionClass($class); + $data = $reflect->getAttributes(Skip::class); + if (count($data) > 0) { + continue; + } $container->parse($class); } }