Total Complexity | 3 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class Maybe |
||
8 | { |
||
9 | private function __construct() |
||
10 | { |
||
11 | } |
||
12 | |||
13 | final public static function nothing() |
||
14 | { |
||
15 | return new class() extends Maybe implements Nothing {}; |
||
16 | } |
||
17 | |||
18 | final public static function just($value) |
||
19 | { |
||
20 | return new class($value) extends Maybe implements Just { |
||
21 | private $value; |
||
22 | |||
23 | public function __construct($value) |
||
27 | |||
28 | public function get() |
||
32 | }; |
||
33 | } |
||
34 | } |
||
35 |