| 1 | <?php |
||
| 10 | class ZendeskChannel |
||
| 11 | { |
||
| 12 | /** @var HttpClient */ |
||
| 13 | protected $client; |
||
| 14 | |||
| 15 | /** @var array */ |
||
| 16 | protected $parameters; |
||
| 17 | |||
| 18 | /** @param HttpClient $client */ |
||
| 19 | 2 | public function __construct(HttpClient $client) |
|
| 23 | |||
| 24 | /** |
||
| 25 | * Send the given notification. |
||
| 26 | * |
||
| 27 | * @param mixed $notifiable |
||
| 28 | * @param \Illuminate\Notifications\Notification $notification |
||
| 29 | * |
||
| 30 | * @throws \NotificationChannels\Zendesk\Exceptions\InvalidConfiguration |
||
| 31 | * @throws \NotificationChannels\Zendesk\Exceptions\CouldNotSendNotification |
||
| 32 | */ |
||
| 33 | 2 | public function send($notifiable, Notification $notification) |
|
| 34 | { |
||
| 35 | 2 | $this->parameters = $notification->toZendesk($notifiable)->toArray(); |
|
|
1 ignored issue
–
show
|
|||
| 36 | |||
| 37 | 2 | $this->prepareParameter($notifiable); |
|
| 38 | |||
| 39 | try { |
||
| 40 | 2 | $this->client->tickets()->create($this->parameters); |
|
| 41 | 2 | } catch (\Exception $e) { |
|
| 42 | throw CouldNotSendNotification::serviceRespondedWithAnError($e->getMessage()); |
||
| 43 | } |
||
| 44 | 2 | } |
|
| 45 | |||
| 46 | /** |
||
| 47 | * Prepare the parameters before to be send. |
||
| 48 | * |
||
| 49 | * @param mixed $notifiable |
||
| 50 | */ |
||
| 51 | 2 | private function prepareParameter($notifiable) |
|
| 64 | } |
||
| 65 |
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.