Skip to content

Commit 2665d9b

Browse files
committed
change method name
1 parent fed3c68 commit 2665d9b

1 file changed

Lines changed: 13 additions & 17 deletions

File tree

src/Illuminate/Events/Dispatcher.php

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,19 @@ protected function shouldBroadcast(array $payload)
244244
{
245245
return isset($payload[0]) &&
246246
$payload[0] instanceof ShouldBroadcast &&
247-
$this->checkBroadcastCondition($payload[0]);
247+
$this->broadcastWhen($payload[0]);
248+
}
249+
250+
/**
251+
* Check if event should be broadcasted by condition.
252+
*
253+
* @param mixed $event
254+
* @return bool
255+
*/
256+
protected function broadcastWhen($event)
257+
{
258+
return method_exists($event, 'broadcastWhen')
259+
? $event->broadcastWhen() : true;
248260
}
249261

250262
/**
@@ -548,20 +560,4 @@ public function setQueueResolver(callable $resolver)
548560

549561
return $this;
550562
}
551-
552-
/**
553-
* Check if event should be broadcasted by condition.
554-
*
555-
* @param $event
556-
*
557-
* @return bool
558-
*/
559-
protected function checkBroadcastCondition($event)
560-
{
561-
if (method_exists($event, 'broadcastWhen')) {
562-
return $event->broadcastWhen();
563-
}
564-
565-
return true;
566-
}
567563
}

0 commit comments

Comments
 (0)