Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function format(NotificationInterface $notification) |
||
12 | { |
||
13 | $notification->setChannel(self::CHANNEL); |
||
14 | parent::format($notification); |
||
15 | |||
16 | // /** @var Emailable $notifiable */ |
||
17 | $notifiable = $notification->getNotifiable(); |
||
18 | // @TODO: |
||
19 | // if (!$notifiable instanceof Emailable) { |
||
|
|||
20 | // throw new MessageFormatException( |
||
21 | // 'Notifiable must implement Emailable interface in order to format email message' |
||
22 | // ); |
||
23 | // } |
||
24 | |||
25 | // Build the dispatch data array. |
||
26 | $dispatchData = [ |
||
27 | 'id' => $notifiable->getId(), |
||
28 | ]; |
||
29 | |||
30 | $messageData = self::createMessagaData($notification->getDataArray()); |
||
31 | $message = self::createMessage($dispatchData, $messageData, self::CHANNEL); |
||
32 | |||
33 | return $message; |
||
34 | } |
||
35 | } |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.