Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | final class WrongType extends TypeError |
||
10 | { |
||
11 | public function __construct($message) |
||
12 | { |
||
13 | parent::__construct($this->wrapMessage($message)); |
||
14 | } |
||
15 | |||
16 | public static function wrap(TypeError $typeError): self |
||
17 | { |
||
18 | return new self($typeError->getMessage()); |
||
19 | } |
||
20 | |||
21 | public static function withMessage(string $message): self |
||
22 | { |
||
23 | return new self($message); |
||
24 | } |
||
25 | |||
26 | private function wrapMessage(string $message): string |
||
33 | } |
||
34 | } |
||
35 |