Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function __construct(string $template, array $blocks) |
||
18 | { |
||
19 | $blocksCount = count($blocks); |
||
20 | $verb = 'is'; |
||
21 | $blocks = implode(', ', $blocks); |
||
22 | |||
23 | if ($blocksCount > 1) { |
||
24 | $verb = 'are'; |
||
25 | } elseif ($blocksCount < 1) { |
||
26 | $blocks = 'none'; |
||
27 | } |
||
28 | |||
29 | $message = "Missing email block in {$template} template, currently there {$verb} {$blocks} available."; |
||
30 | parent::__construct($message); |
||
31 | } |
||
32 | } |
||
33 |