Total Complexity | 4 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
13 | class ProcessWebhook |
||
14 | { |
||
15 | use Dispatchable, InteractsWithQueue, Queueable; |
||
16 | |||
17 | /** |
||
18 | * @var Webhook |
||
19 | */ |
||
20 | private $webhook; |
||
21 | |||
22 | public function __construct(Webhook $message) |
||
23 | { |
||
24 | $this->webhook = $message; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param string $type |
||
29 | * @param $context |
||
30 | * @param string $url |
||
31 | * @param string|null $queue |
||
32 | * |
||
33 | * @return ProcessWebhook |
||
34 | */ |
||
35 | public static function queued(string $type, $context, string $url, ?string $queue = null): self |
||
36 | { |
||
37 | return static::create($type, $context, $url)->onQueue($queue ?? config('webhooks.webhook-queue')); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param string $type |
||
42 | * @param $context |
||
43 | * @param string $url |
||
44 | * |
||
45 | * @return ProcessWebhook |
||
46 | */ |
||
47 | public static function create(string $type, $context, string $url): self |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @param Channel $channel |
||
54 | */ |
||
55 | public function handle(Channel $channel): void |
||
60 |