Completed
Push — master ( b93bd2...539d39 )
by Randy
01:46
created

src/Optional.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Dgame\Optional;
4
5
/**
6
 * Interface Optional
7
 * @package Dgame\Optional
8
 */
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 $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 $value
49
     *
50
     * @return bool
51
     */
52
    public function isEqualTo($value): bool;
53
54
    /**
55
     * @param $value
56
     *
57
     * @return bool
58
     */
59
    public function isNotEqualTo($value): bool;
60
61
    /**
62
     * @param $value
63
     *
64
     * @return bool
65
     */
66
    public function isIdenticalTo($value): bool;
67
68
    /**
69
     * @param $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);
0 ignored issues
show
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
79
}