| Conditions | 4 |
| Paths | 4 |
| Total Lines | 27 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function run($request) |
||
| 33 | { |
||
| 34 | $email = $request->remaining(); |
||
| 35 | $params = $request->allParams(); |
||
| 36 | $url = "/dev/{$params['Action']}/{$params['TaskName']}"; |
||
| 37 | |||
| 38 | echo '<h2>Choose Email</h2>'; |
||
| 39 | echo '<ul>'; |
||
| 40 | foreach ($this->previewableEmails as $key => $method) { |
||
| 41 | echo '<li><a href="' . $url . '/' . $method . '">' . $method . '</a></li>'; |
||
| 42 | } |
||
| 43 | echo '</ul><hr>'; |
||
| 44 | |||
| 45 | if ($email && in_array($email,$this->previewableEmails)) { |
||
| 46 | $order = Order::get()->first(); |
||
| 47 | $notifier = OrderEmailNotifier::create($order) |
||
|
|
|||
| 48 | ->setDebugMode(true); |
||
| 49 | $method = "send$email"; |
||
| 50 | echo $notifier->$method(); |
||
| 51 | |||
| 52 | } else { |
||
| 53 | |||
| 54 | } |
||
| 55 | //this is a little hardcore way of ending the party, |
||
| 56 | //but as it's only used for styling, it works for now |
||
| 57 | die; |
||
| 58 | } |
||
| 59 | } |
||
| 60 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: