Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 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 | 3 | 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 | 3 | public function send($notifiable, Notification $notification) | |
| 45 | |||
| 46 | /** | ||
| 47 | * Send update ticket request. | ||
| 48 | * | ||
| 49 | * @param mixed $notifiable | ||
| 50 | */ | ||
| 51 | 1 | View Code Duplication | private function updateTicket($id, $notifiable) | 
| 1 ignored issue–
                            show | |||
| 52 |     { | ||
| 53 | 1 | $this->prepareUpdateParameters(); | |
| 54 | |||
| 55 |         try { | ||
| 56 | 1 | $this->client->tickets()->update($id, $this->parameters); | |
| 57 |         } catch (\Exception $e) { | ||
| 58 | throw CouldNotSendNotification::serviceRespondedWithAnError($e->getMessage()); | ||
| 59 | } | ||
| 60 | 1 | } | |
| 61 | |||
| 62 | /** | ||
| 63 | * Send create ticket request. | ||
| 64 | * | ||
| 65 | * @param mixed $notifiable | ||
| 66 | */ | ||
| 67 | 2 | View Code Duplication | private function createNewTicket($notifiable) | 
| 1 ignored issue–
                            show | |||
| 68 |     { | ||
| 69 | 2 | $this->prepareCreateParameter($notifiable); | |
| 70 | |||
| 71 |         try { | ||
| 72 | 2 | $this->client->tickets()->create($this->parameters); | |
| 73 |         } catch (\Exception $e) { | ||
| 74 | throw CouldNotSendNotification::serviceRespondedWithAnError($e->getMessage()); | ||
| 75 | } | ||
| 76 | 2 | } | |
| 77 | |||
| 78 | /** | ||
| 79 | * Prepare the parameters before update request send. | ||
| 80 | * | ||
| 81 | * @param mixed $notifiable | ||
| 82 | */ | ||
| 83 | 1 | public function prepareUpdateParameters() | |
| 87 | |||
| 88 | /** | ||
| 89 | * Prepare the parameters before create request send. | ||
| 90 | * | ||
| 91 | * @param mixed $notifiable | ||
| 92 | */ | ||
| 93 | 2 | private function prepareCreateParameter($notifiable) | |
| 108 | } | ||
| 109 | 
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.