From c0b95a1aa9a5063e46ece256413bfce520f4178d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Sat, 2 Mar 2024 23:02:29 +0100 Subject: [PATCH] qa: use `is_object` over `isset` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- src/Pattern/CallbackCache.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Pattern/CallbackCache.php b/src/Pattern/CallbackCache.php index 22d773ac..23fa08fe 100644 --- a/src/Pattern/CallbackCache.php +++ b/src/Pattern/CallbackCache.php @@ -118,6 +118,8 @@ protected function generateCallbackKey(callable $callback, array $args): string // functions, methods and classnames are case-insensitive $callbackKey = strtolower($callbackKey); + $object = null; + // generate a unique key of object callbacks if (is_object($callback)) { // Closures & __invoke @@ -126,7 +128,8 @@ protected function generateCallbackKey(callable $callback, array $args): string // array($object, 'method') $object = $callback[0]; } - if (isset($object)) { + + if (is_object($object)) { try { $serializedObject = serialize($object); } catch (Throwable $throwable) {