From 4cba2b3c1a936245d762ac5dcb832319c2b60116 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Wed, 28 Nov 2018 10:19:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=A0=B8=E5=BF=83):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=20TS+=20=E8=8E=B7=E5=8F=96=E6=9C=AA=E8=AF=BB=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #449 --- app/Support/PinnedsNotificationEventer.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/Support/PinnedsNotificationEventer.php b/app/Support/PinnedsNotificationEventer.php index e0568be80..cffb2a15e 100644 --- a/app/Support/PinnedsNotificationEventer.php +++ b/app/Support/PinnedsNotificationEventer.php @@ -70,10 +70,18 @@ public function dispatch() { $notifications = collect($this->events->dispatch($this->prefix)); - $notifications = $notifications->reject(function ($notification) { - return (! isset($notification['namespace']) && $notification['namespace'] && class_exists($notification['namespace'])) || array_diff_key($this->fillable, $notification); - }); + return $notification->reject(function ($notification): bool { + if (! is_array($notification)) { + return true; + } elseif (! isset($notification['namespace'])) { + return true; + } elseif (! class_exists($notification['namespace'])) { + return true; + } elseif (array_diff_key($this->fillable, $notification)) { + return true; + } - return $notifications; + return false; + }); } }