Conditions | 2 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | function memoize(callable $f) |
||
|
|||
13 | { |
||
14 | return function () use ($f) { |
||
15 | static $memoize = array(); |
||
16 | $memoize_key = md5(json_encode(func_get_args())); |
||
17 | if (isset($memoize[ $memoize_key ])) { |
||
18 | return $memoize[ $memoize_key ]; |
||
19 | } |
||
20 | |||
21 | return $memoize[ $memoize_key ] = call_user_func_array($f, func_get_args()); |
||
22 | }; |
||
23 | } |
||
24 |
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.