From 2576d84860f27bf31d94483194f82b7647525d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sat, 22 Apr 2023 02:04:31 +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 --- src/Handler.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Handler.php b/src/Handler.php index 7e09f7b..d71baa7 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -34,6 +34,19 @@ class Handler implements RequestHandlerInterface } + /** + * @param string $interface + * @return bool + */ + public function implement(string $interface): bool + { + if (!$this->isClosure()) { + return $this->handler[0] instanceof $interface; + } + return false; + } + + /** * @return string|null */