Conditions | 2 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function benchPartial() |
||
13 | { |
||
14 | $ifElse = partial(function (callable $pred, callable $succfn, callable $failfn, $x) { |
||
15 | return $pred($x) |
||
16 | ? $succfn($x) |
||
17 | : $failfn($x); |
||
18 | }); |
||
19 | |||
20 | $ifElse(function ($x) { |
||
21 | return $x === 10; |
||
22 | }) |
||
23 | (function () { |
||
24 | return true; |
||
25 | }) |
||
26 | (function () { |
||
27 | return false; |
||
28 | }) |
||
29 | (10); |
||
30 | } |
||
31 | |||
46 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.