1 | <?php |
||||||
2 | |||||||
3 | namespace HoomanMirghasemi\Sms\Channels; |
||||||
4 | |||||||
5 | use Exception; |
||||||
6 | use HoomanMirghasemi\Sms\Abstracts\Driver; |
||||||
7 | use HoomanMirghasemi\Sms\VoiceCallManager; |
||||||
8 | use Illuminate\Notifications\Notification; |
||||||
9 | |||||||
10 | class VoiceCallChannel |
||||||
11 | { |
||||||
12 | /** |
||||||
13 | * Send notification. |
||||||
14 | * |
||||||
15 | * @param $notifiable |
||||||
16 | * @param Notification $notification |
||||||
17 | * |
||||||
18 | * @throws Exception |
||||||
19 | * |
||||||
20 | * @return void |
||||||
21 | */ |
||||||
22 | public function send($notifiable, Notification $notification): void |
||||||
23 | { |
||||||
24 | $manager = $notification->toVoiceCall($notifiable); |
||||||
0 ignored issues
–
show
|
|||||||
25 | if (!is_null($manager)) { |
||||||
26 | $this->validate($manager); |
||||||
27 | $manager->send(); |
||||||
0 ignored issues
–
show
The method
send() does not exist on HoomanMirghasemi\Sms\VoiceCallManager . Since you implemented __call , consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
28 | } |
||||||
29 | } |
||||||
30 | |||||||
31 | /** |
||||||
32 | * Validate sms. |
||||||
33 | * |
||||||
34 | * @throws Exception |
||||||
35 | * |
||||||
36 | * @return void |
||||||
37 | */ |
||||||
38 | protected function validate($manager): void |
||||||
39 | { |
||||||
40 | if (!$manager instanceof VoiceCallManager && !$manager instanceof Driver) { |
||||||
41 | throw new Exception('Invalid data for voice call notification.'); |
||||||
42 | } |
||||||
43 | } |
||||||
44 | } |
||||||
45 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.