1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Cypress\Curry; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Addition; `+` operator |
7
|
|
|
* |
8
|
|
|
* @internal |
9
|
|
|
* @param mixed $a |
10
|
|
|
* @param mixed $b |
11
|
|
|
* @return mixed |
12
|
|
|
*/ |
13
|
|
|
function _operator_a979ef10cc6f6a36df6b8a323307ee3bb2e2db9c($a, $b) |
14
|
|
|
{ |
15
|
|
|
return $a + $b; |
16
|
|
|
} |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Subtraction; `-` operator |
20
|
|
|
* |
21
|
|
|
* @internal |
22
|
|
|
* @param mixed $a |
23
|
|
|
* @param mixed $b |
24
|
|
|
* @return mixed |
25
|
|
|
*/ |
26
|
|
|
function _operator_3bc15c8aae3e4124dd409035f32ea2fd6835efc9($a, $b) |
27
|
|
|
{ |
28
|
|
|
return $a - $b; |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Multiplication; `*` operator |
33
|
|
|
* |
34
|
|
|
* @internal |
35
|
|
|
* @param mixed $a |
36
|
|
|
* @param mixed $b |
37
|
|
|
* @return mixed |
38
|
|
|
*/ |
39
|
|
|
function _operator_df58248c414f342c81e056b40bee12d17a08bf61($a, $b) |
40
|
|
|
{ |
41
|
|
|
return $a * $b; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Division; `/` operator |
46
|
|
|
* |
47
|
|
|
* @internal |
48
|
|
|
* @param mixed $a |
49
|
|
|
* @param mixed $b |
50
|
|
|
* @return mixed |
51
|
|
|
*/ |
52
|
|
|
function _operator_42099b4af021e53fd8fd4e056c2568d7c2e3ffa8($a, $b) |
53
|
|
|
{ |
54
|
|
|
return $a / $b; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Modulo; `%` operator |
59
|
|
|
* |
60
|
|
|
* @internal |
61
|
|
|
* @param mixed $a |
62
|
|
|
* @param mixed $b |
63
|
|
|
* @return mixed |
64
|
|
|
*/ |
65
|
|
|
function _operator_4345cb1fa27885a8fbfe7c0c830a592cc76a552b($a, $b) |
66
|
|
|
{ |
67
|
|
|
return $a % $b; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Exponentiation; `**` operator |
72
|
|
|
* |
73
|
|
|
* @internal |
74
|
|
|
* @param mixed $a |
75
|
|
|
* @param mixed $b |
76
|
|
|
* @return mixed |
77
|
|
|
*/ |
78
|
|
|
function _operator_bc2f74c22f98f7b6ffbc2f67453dbfa99bce9a32($a, $b) |
79
|
|
|
{ |
80
|
|
|
return $a ** $b; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* Equal; '==' operator |
86
|
|
|
* |
87
|
|
|
* @internal |
88
|
|
|
* @param mixed $a |
89
|
|
|
* @param mixed $b |
90
|
|
|
* @return mixed |
91
|
|
|
*/ |
92
|
|
|
function _operator_6947818ac409551f11fbaa78f0ea6391960aa5b8($a, $b) |
93
|
|
|
{ |
94
|
|
|
return $a == $b; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* Identical; '===' operator |
99
|
|
|
* |
100
|
|
|
* @internal |
101
|
|
|
* @param mixed $a |
102
|
|
|
* @param mixed $b |
103
|
|
|
* @return mixed |
104
|
|
|
*/ |
105
|
|
|
function _operator_b64cc2760536699c09c33fd0c38b16350e500872($a, $b) |
106
|
|
|
{ |
107
|
|
|
return $a === $b; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* Not equal; '!=' operator |
112
|
|
|
* |
113
|
|
|
* @internal |
114
|
|
|
* @param mixed $a |
115
|
|
|
* @param mixed $b |
116
|
|
|
* @return mixed |
117
|
|
|
*/ |
118
|
|
|
function _operator_d066fc085455ed98db6ac1badc818019c77c44ab($a, $b) |
119
|
|
|
{ |
120
|
|
|
return $a != $b; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* Not identical; '!==' operator |
125
|
|
|
* |
126
|
|
|
* @internal |
127
|
|
|
* @param mixed $a |
128
|
|
|
* @param mixed $b |
129
|
|
|
* @return mixed |
130
|
|
|
*/ |
131
|
|
|
function _operator_b7192c948f69d7776ba52c9d03f8632ec6afe9de($a, $b) |
132
|
|
|
{ |
133
|
|
|
return $a !== $b; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* Less than; '<' operator |
138
|
|
|
* |
139
|
|
|
* @internal |
140
|
|
|
* @param mixed $a |
141
|
|
|
* @param mixed $b |
142
|
|
|
* @return mixed |
143
|
|
|
*/ |
144
|
|
|
function _operator_c4dd3c8cdd8d7c95603dd67f1cd873d5f9148b29($a, $b) |
145
|
|
|
{ |
146
|
|
|
return $a < $b; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* Greater than; '>' operator |
151
|
|
|
* |
152
|
|
|
* @internal |
153
|
|
|
* @param mixed $a |
154
|
|
|
* @param mixed $b |
155
|
|
|
* @return mixed |
156
|
|
|
*/ |
157
|
|
|
function _operator_091385be99b45f459a231582d583ec9f3fa3d194($a, $b) |
158
|
|
|
{ |
159
|
|
|
return $a > $b; |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* Less than or equal to; '<=' operator |
164
|
|
|
* |
165
|
|
|
* @internal |
166
|
|
|
* @param mixed $a |
167
|
|
|
* @param mixed $b |
168
|
|
|
* @return mixed |
169
|
|
|
*/ |
170
|
|
|
function _operator_8a681a2f041f4625cceacf20f0cf8ebf4248b5f1($a, $b) |
171
|
|
|
{ |
172
|
|
|
return $a <= $b; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* Greater than or equal to; '>=' operator |
177
|
|
|
* |
178
|
|
|
* @internal |
179
|
|
|
* @param mixed $a |
180
|
|
|
* @param mixed $b |
181
|
|
|
* @return mixed |
182
|
|
|
*/ |
183
|
|
|
function _operator_6c22e68f3b484db9779ac9e86488c2648313c410($a, $b) |
184
|
|
|
{ |
185
|
|
|
return $a >= $b; |
186
|
|
|
} |
187
|
|
|
|
188
|
|
|
/** |
189
|
|
|
* Ternary; '?' operator ($if ? $then : $else) |
190
|
|
|
* |
191
|
|
|
* @internal |
192
|
|
|
* @param bool $if |
193
|
|
|
* @param mixed $then |
194
|
|
|
* @param mixed $else |
195
|
|
|
* @return mixed |
196
|
|
|
*/ |
197
|
|
|
function _operator_5bab61eb53176449e25c2c82f172b82cb13ffb9d($if, $then, $else) |
198
|
|
|
{ |
199
|
|
|
return $if ? $then : $else; |
200
|
|
|
} |
201
|
|
|
|
202
|
|
|
/** |
203
|
|
|
* Elvis; '?:' operator ($select ?: $else) |
204
|
|
|
* |
205
|
|
|
* @internal |
206
|
|
|
* @param mixed $select |
207
|
|
|
* @param mixed $else |
208
|
|
|
* @return mixed |
209
|
|
|
*/ |
210
|
|
|
function _operator_e305f01faf8d7245a465629effccc67bc3d32ef7($select, $else) |
211
|
|
|
{ |
212
|
|
|
return $select ?: $else; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* Concatenation; '.' operator |
217
|
|
|
* |
218
|
|
|
* @internal |
219
|
|
|
* @param string $a |
220
|
|
|
* @param string $b |
221
|
|
|
* @return string |
222
|
|
|
*/ |
223
|
|
|
function _operator_3a52ce780950d4d969792a2559cd519d7ee8c727($a, $b) |
224
|
|
|
{ |
225
|
|
|
return $a . $b; |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
/** |
229
|
|
|
* Logical and; '&&' operator |
230
|
|
|
* |
231
|
|
|
* @internal |
232
|
|
|
* @param mixed $a |
233
|
|
|
* @param mixed $b |
234
|
|
|
* @return bool |
235
|
|
|
*/ |
236
|
|
|
function _operator_436f27a6ccf1ee52cf01c9775136ff5ecb4f3a72($a, $b) |
237
|
|
|
{ |
238
|
|
|
return $a && $b; |
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
/** |
242
|
|
|
* Logical and; 'and' operator |
243
|
|
|
* |
244
|
|
|
* @internal |
245
|
|
|
* @param mixed $a |
246
|
|
|
* @param mixed $b |
247
|
|
|
* @return bool |
248
|
|
|
*/ |
249
|
|
|
function _operator_and($a, $b) |
250
|
|
|
{ |
251
|
|
|
return $a && $b; |
252
|
|
|
} |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* Logical or; '||' operator |
256
|
|
|
* |
257
|
|
|
* @internal |
258
|
|
|
* @param mixed $a |
259
|
|
|
* @param mixed $b |
260
|
|
|
* @return bool |
261
|
|
|
*/ |
262
|
|
|
function _operator_c65f37b2cb1ae26c89e9b4f26e2ca9e9cde4ae5b($a, $b) |
263
|
|
|
{ |
264
|
|
|
return $a || $b; |
265
|
|
|
} |
266
|
|
|
|
267
|
|
|
/** |
268
|
|
|
* Logical or; 'or' operator |
269
|
|
|
* |
270
|
|
|
* @internal |
271
|
|
|
* @param mixed $a |
272
|
|
|
* @param mixed $b |
273
|
|
|
* @return bool |
274
|
|
|
*/ |
275
|
|
|
function _operator_or($a, $b) |
276
|
|
|
{ |
277
|
|
|
return $a || $b; |
278
|
|
|
} |
279
|
|
|
|
280
|
|
|
/** |
281
|
|
|
* Logical xor; 'xor' operator |
282
|
|
|
* |
283
|
|
|
* @internal |
284
|
|
|
* @param mixed $a |
285
|
|
|
* @param mixed $b |
286
|
|
|
* @return bool |
287
|
|
|
*/ |
288
|
|
|
function _operator_xor($a, $b) |
289
|
|
|
{ |
290
|
|
|
return $a xor $b; |
291
|
|
|
} |
292
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* Logical not; '!' operator |
295
|
|
|
* |
296
|
|
|
* @internal |
297
|
|
|
* @param mixed $a |
298
|
|
|
* @param mixed $b |
|
|
|
|
299
|
|
|
* @return bool |
300
|
|
|
*/ |
301
|
|
|
function _operator_0ab8318acaf6e678dd02e2b5c343ed41111b393d($a) |
302
|
|
|
{ |
303
|
|
|
return !$a; |
304
|
|
|
} |
305
|
|
|
|
306
|
|
|
/** |
307
|
|
|
* Logical not (alias) |
308
|
|
|
* |
309
|
|
|
* @internal |
310
|
|
|
* @param mixed $a |
311
|
|
|
* @param mixed $b |
|
|
|
|
312
|
|
|
* @return bool |
313
|
|
|
*/ |
314
|
|
|
function _operator_not($a) |
315
|
|
|
{ |
316
|
|
|
return !$a; |
317
|
|
|
} |
318
|
|
|
|
319
|
|
|
|
320
|
|
|
/** |
321
|
|
|
* Bitwise and; '&' operator |
322
|
|
|
* |
323
|
|
|
* @internal |
324
|
|
|
* @param int $a |
325
|
|
|
* @param int $b |
326
|
|
|
* @return int |
327
|
|
|
*/ |
328
|
|
|
function _operator_7c4d33785daa5c2370201ffa236b427aa37c9996($a, $b) |
329
|
|
|
{ |
330
|
|
|
return $a & $b; |
331
|
|
|
} |
332
|
|
|
|
333
|
|
|
/** |
334
|
|
|
* Bitwise or; '|' operator |
335
|
|
|
* |
336
|
|
|
* @internal |
337
|
|
|
* @param int $a |
338
|
|
|
* @param int $b |
339
|
|
|
* @return int |
340
|
|
|
*/ |
341
|
|
|
function _operator_3eb416223e9e69e6bb8ee19793911ad1ad2027d8($a, $b) |
342
|
|
|
{ |
343
|
|
|
return $a | $b; |
344
|
|
|
} |
345
|
|
|
|
346
|
|
|
/** |
347
|
|
|
* Bitwise xor; '^' operator |
348
|
|
|
* |
349
|
|
|
* @internal |
350
|
|
|
* @param int $a |
351
|
|
|
* @param int $b |
352
|
|
|
* @return int |
353
|
|
|
*/ |
354
|
|
|
function _operator_5e6f80a34a9798cafc6a5db96cc57ba4c4db59c2($a, $b) |
355
|
|
|
{ |
356
|
|
|
return $a ^ $b; |
357
|
|
|
} |
358
|
|
|
|
359
|
|
|
/** |
360
|
|
|
* Bitwise not; '~' operator |
361
|
|
|
* |
362
|
|
|
* @internal |
363
|
|
|
* @param int $a |
364
|
|
|
* @return int |
365
|
|
|
*/ |
366
|
|
|
function _operator_fb3c6e4de85bd9eae26fdc63e75f10a7f39e850e($a) |
367
|
|
|
{ |
368
|
|
|
return ~$a; |
369
|
|
|
} |
370
|
|
|
|
371
|
|
|
/** |
372
|
|
|
* Bitwise shift left; '<<' operator |
373
|
|
|
* |
374
|
|
|
* @internal |
375
|
|
|
* @param int $a |
376
|
|
|
* @param int $b |
377
|
|
|
* @return int |
378
|
|
|
*/ |
379
|
|
|
function _operator_79047441987fa5937e857918d596ca65a8994f05($a, $b) |
380
|
|
|
{ |
381
|
|
|
return $a << $b; |
382
|
|
|
} |
383
|
|
|
|
384
|
|
|
/** |
385
|
|
|
* Bitwise shift right; '>>' operator |
386
|
|
|
* |
387
|
|
|
* @internal |
388
|
|
|
* @param int $a |
389
|
|
|
* @param int $b |
390
|
|
|
* @return int |
391
|
|
|
*/ |
392
|
|
|
function _operator_74562623d15859b6a47065e0f98ce1202fb56506($a, $b) |
393
|
|
|
{ |
394
|
|
|
return $a >> $b; |
395
|
|
|
} |
396
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.