1 | <?php |
||
10 | abstract class Monad |
||
|
|||
11 | { |
||
12 | |||
13 | protected $value; |
||
14 | |||
15 | /** |
||
16 | * Allow Monad::map() to be called like a method |
||
17 | * |
||
18 | * @param callable $f |
||
19 | * |
||
20 | * @return mixed |
||
21 | */ |
||
22 | public function __invoke($f) |
||
26 | |||
27 | /** |
||
28 | * @param mixed $a |
||
29 | */ |
||
30 | private function __construct($a) |
||
34 | |||
35 | /** |
||
36 | * Instantiate a new Monad wrapping a given value |
||
37 | * |
||
38 | * @param mixed $a |
||
39 | * |
||
40 | * @return Monad |
||
41 | */ |
||
42 | public static function of($a) |
||
46 | |||
47 | /** |
||
48 | * Apply a function to this Monad's value |
||
49 | * |
||
50 | * @param callable $f |
||
51 | * |
||
52 | * @return Monad |
||
53 | */ |
||
54 | public function map(callable $f) |
||
60 | |||
61 | /** |
||
62 | * Get this Monad's value without wrapping it. |
||
63 | * @return mixed |
||
64 | */ |
||
65 | public function value() |
||
69 | } |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.