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 |
||
| 11 | class SslCheckSucceeded extends BaseNotification |
||
| 12 | { |
||
| 13 | /** @var \Spatie\UptimeMonitor\Events\SslCheckSucceeded */ |
||
| 14 | public $event; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Get the mail representation of the notification. |
||
| 18 | * |
||
| 19 | * @param mixed $notifiable |
||
| 20 | * @return \Illuminate\Notifications\Messages\MailMessage |
||
| 21 | */ |
||
| 22 | public function toMail($notifiable) |
||
| 31 | |||
| 32 | View Code Duplication | public function toSlack($notifiable) |
|
| 41 | |||
| 42 | public function setEvent(ValidSslCertificateFoundEvent $event) |
||
| 48 | } |
||
| 49 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.