| Conditions | 2 |
| Paths | 1 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | function callOnce ($fn) |
||
|
|
|||
| 12 | { |
||
| 13 | return function () use ($fn) { |
||
| 14 | if ($fn === null) return; |
||
| 15 | call_user_func($fn, func_get_args()); |
||
| 16 | $fn = null; |
||
|
1 ignored issue
–
show
|
|||
| 17 | }; |
||
| 18 | } |
||
| 19 | |||
| 43 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.