1 | <?php |
||
11 | class SendBearyChatJob implements ShouldQueue |
||
12 | { |
||
13 | use InteractsWithQueue, Queueable, SerializesModels; |
||
14 | |||
15 | /** |
||
16 | * The BearyChat client. |
||
17 | * |
||
18 | * @var \ElfSundae\BearyChat\Client |
||
19 | */ |
||
20 | protected $client; |
||
21 | |||
22 | /** |
||
23 | * The Message instance to be sent. |
||
24 | * |
||
25 | * @var \ElfSundae\BearyChat\Message |
||
26 | */ |
||
27 | protected $message; |
||
28 | |||
29 | /** |
||
30 | * Create a new job instance. |
||
31 | * |
||
32 | * @param mixed $message A Message instance, or parameters which can be handled |
||
33 | * by the `send` method of a Message instance. |
||
34 | */ |
||
35 | public function __construct($message = null) |
||
55 | |||
56 | /** |
||
57 | * Execute the job. |
||
58 | * |
||
59 | * @return void |
||
60 | */ |
||
61 | public function handle() |
||
69 | |||
70 | /** |
||
71 | * Set the client with client name. |
||
72 | * |
||
73 | * @param string $name |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function client($name) |
||
82 | |||
83 | /** |
||
84 | * Any unhandled methods will be sent to the Message instance. |
||
85 | * |
||
86 | * @param string $method |
||
87 | * @param array $parameters |
||
88 | * @return $this |
||
89 | */ |
||
90 | public function __call($method, $parameters) |
||
100 | } |
||
101 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: