1 | <?php |
||
16 | class Functions |
||
17 | { |
||
18 | /** |
||
19 | * Identity function: returns the only argument. |
||
20 | * @var callable {(x) ==> x} |
||
21 | */ |
||
22 | public static $identity; |
||
23 | /** |
||
24 | * Key function: returns the second argument of two. |
||
25 | * @var callable {(v, k) ==> k} |
||
26 | */ |
||
27 | public static $key; |
||
28 | /** |
||
29 | * Value function: returns the first argument of two. |
||
30 | * @var callable {(v, k) ==> v} |
||
31 | */ |
||
32 | public static $value; |
||
33 | /** |
||
34 | * True function: returns true. |
||
35 | * @var callable {() ==> true} |
||
36 | */ |
||
37 | public static $true; |
||
38 | /** |
||
39 | * False function: returns false. |
||
40 | * @var callable {() ==> false} |
||
41 | */ |
||
42 | public static $false; |
||
43 | /** |
||
44 | * Blank function: does nothing. |
||
45 | * @var callable {() ==> {}} |
||
46 | */ |
||
47 | public static $blank; |
||
48 | /** |
||
49 | * Compare strict function: returns -1, 0 or 1 based on === and > operators. |
||
50 | * @var callable |
||
51 | */ |
||
52 | public static $compareStrict; |
||
53 | /** |
||
54 | * Compare strict function reversed: returns 1, 0 or -1 based on === and > operators. |
||
55 | * @var callable |
||
56 | */ |
||
57 | public static $compareStrictReversed; |
||
58 | /** |
||
59 | * Compare loose function: returns -1, 0 or 1 based on == and > operators. |
||
60 | * @var callable |
||
61 | */ |
||
62 | public static $compareLoose; |
||
63 | /** |
||
64 | * Compare loose function reversed: returns 1, 0 or -1 based on == and > operators. |
||
65 | * @var callable |
||
66 | */ |
||
67 | public static $compareLooseReversed; |
||
68 | /** |
||
69 | * Compare int function: returns the difference between the first and the second argument. |
||
70 | * @var callable |
||
71 | */ |
||
72 | public static $compareInt; |
||
73 | /** |
||
74 | * Compare int function reversed: returns the difference between the second and the first argument. |
||
75 | * @var callable |
||
76 | */ |
||
77 | public static $compareIntReversed; |
||
78 | |||
79 | /** @internal */ |
||
80 | public static function init() |
||
140 | |||
141 | /** |
||
142 | * Increment function: returns incremental integers starting from 0. |
||
143 | * @return callable |
||
144 | */ |
||
145 | public static function increment() |
||
150 | } |
||
151 |