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