| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function getMessageText(string $type): string |
||
| 22 | { |
||
| 23 | $alerts = $this->findAll('css', sprintf('.alert-%s', $type)); |
||
| 24 | if (count($alerts) < 1) { |
||
| 25 | throw new Exception(sprintf("Unable to find any alert with type '%s'", $type)); |
||
| 26 | } |
||
| 27 | |||
| 28 | return implode("\n", array_map(function ($alert) { |
||
| 29 | return $alert->getText(); |
||
| 30 | }, $alerts)); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |