1 | <?php |
||
11 | class MultipleErrors extends InvalidEmail |
||
12 | { |
||
13 | /** |
||
14 | * @var Reason[] |
||
15 | */ |
||
16 | private $reasons = []; |
||
17 | |||
18 | 8 | public function __construct() |
|
21 | |||
22 | 8 | public function addReason(Reason $reason) : void |
|
26 | |||
27 | /** |
||
28 | * @return Reason[] |
||
29 | */ |
||
30 | 2 | public function getReasons() : array |
|
34 | |||
35 | 1 | public function reason() : Reason |
|
36 | { |
||
37 | 1 | return $this->reasons[0]; |
|
38 | } |
||
39 | |||
40 | 1 | public function description() : string |
|
41 | { |
||
42 | 1 | $description = ''; |
|
43 | 1 | foreach($this->reasons as $reason) { |
|
44 | 1 | $description .= $reason->description() . PHP_EOL; |
|
45 | } |
||
46 | |||
47 | 1 | return $description; |
|
48 | } |
||
49 | |||
50 | public function code() : int |
||
54 | } |
||
55 |