Total Lines | 71 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | interface Optional |
||
10 | { |
||
11 | /** |
||
12 | * @param mixed $value |
||
13 | * |
||
14 | * @return bool |
||
15 | */ |
||
16 | public function isSome(&$value = null): bool; |
||
17 | |||
18 | /** |
||
19 | * @return bool |
||
20 | */ |
||
21 | public function isNone(): bool; |
||
22 | |||
23 | /** |
||
24 | * @return mixed |
||
25 | */ |
||
26 | public function unwrap(); |
||
27 | |||
28 | /** |
||
29 | * @param mixed $value |
||
30 | * |
||
31 | * @return mixed |
||
32 | */ |
||
33 | public function default($value); |
||
34 | |||
35 | /** |
||
36 | * @param callable $callback |
||
37 | * |
||
38 | * @return Optional |
||
|
|||
39 | */ |
||
40 | public function ensure(callable $callback): self; |
||
41 | |||
42 | /** |
||
43 | * @return Optional |
||
44 | */ |
||
45 | public function ensureNotFalse(): self; |
||
46 | |||
47 | /** |
||
48 | * @param mixed $value |
||
49 | * |
||
50 | * @return bool |
||
51 | */ |
||
52 | public function isEqualTo($value): bool; |
||
53 | |||
54 | /** |
||
55 | * @param mixed $value |
||
56 | * |
||
57 | * @return bool |
||
58 | */ |
||
59 | public function isNotEqualTo($value): bool; |
||
60 | |||
61 | /** |
||
62 | * @param mixed $value |
||
63 | * |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function isIdenticalTo($value): bool; |
||
67 | |||
68 | /** |
||
69 | * @param mixed $value |
||
70 | * |
||
71 | * @return bool |
||
72 | */ |
||
73 | public function isNotIdenticalTo($value): bool; |
||
74 | |||
75 | /** |
||
76 | * @param callable $callback |
||
77 | */ |
||
78 | public function do(callable $callback); |
||
79 | } |
||
80 |
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.