From 2665d9b9a49633d73c71db735c2597c8b960c985 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 28 Apr 2017 08:11:17 -0500 Subject: [PATCH] change method name --- src/Illuminate/Events/Dispatcher.php | 30 ++++++++++++---------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/Illuminate/Events/Dispatcher.php b/src/Illuminate/Events/Dispatcher.php index 066aafe67375..08f2fd1e8943 100755 --- a/src/Illuminate/Events/Dispatcher.php +++ b/src/Illuminate/Events/Dispatcher.php @@ -244,7 +244,19 @@ protected function shouldBroadcast(array $payload) { return isset($payload[0]) && $payload[0] instanceof ShouldBroadcast && - $this->checkBroadcastCondition($payload[0]); + $this->broadcastWhen($payload[0]); + } + + /** + * Check if event should be broadcasted by condition. + * + * @param mixed $event + * @return bool + */ + protected function broadcastWhen($event) + { + return method_exists($event, 'broadcastWhen') + ? $event->broadcastWhen() : true; } /** @@ -548,20 +560,4 @@ public function setQueueResolver(callable $resolver) return $this; } - - /** - * Check if event should be broadcasted by condition. - * - * @param $event - * - * @return bool - */ - protected function checkBroadcastCondition($event) - { - if (method_exists($event, 'broadcastWhen')) { - return $event->broadcastWhen(); - } - - return true; - } }