1 | <?php |
||
12 | final class None extends OptionalBase |
||
13 | { |
||
14 | /** |
||
15 | * @var None |
||
16 | */ |
||
17 | private static $instance; |
||
18 | |||
19 | /** |
||
20 | * None constructor. |
||
21 | */ |
||
22 | private function __construct() |
||
25 | |||
26 | /** |
||
27 | * |
||
28 | */ |
||
29 | private function __clone() |
||
32 | |||
33 | /** |
||
34 | * @return None |
||
|
|||
35 | */ |
||
36 | public static function instance(): self |
||
44 | |||
45 | /** |
||
46 | * @param mixed $value |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function isSome(&$value = null): bool |
||
56 | |||
57 | /** |
||
58 | * @throws Exception |
||
59 | */ |
||
60 | public function unwrap(): void |
||
64 | |||
65 | /** |
||
66 | * @param callable $callback |
||
67 | * |
||
68 | * @return Optional |
||
69 | */ |
||
70 | public function ensure(callable $callback): Optional |
||
74 | |||
75 | /** |
||
76 | * @param mixed $value |
||
77 | * |
||
78 | * @return bool |
||
79 | */ |
||
80 | public function isEqualTo($value): bool |
||
84 | |||
85 | /** |
||
86 | * @param mixed $value |
||
87 | * |
||
88 | * @return bool |
||
89 | */ |
||
90 | public function isIdenticalTo($value): bool |
||
94 | } |
||
95 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.