Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (danger)
50.00%
1 / 2
CRAP
87.50% covered (warning)
87.50%
7 / 8
CoveredClassWithAnonymousFunctionInStaticMethod
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (danger)
50.00%
1 / 2
2.01
87.50% covered (warning)
87.50%
7 / 8
 runAnonymous
0.00% covered (danger)
0.00%
0 / 1
1.04
66.67% covered (warning)
66.67%
2 / 3
 anonymousFunction:11#41
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
<?php
class CoveredClassWithAnonymousFunctionInStaticMethod
{
    public static function runAnonymous()
    {
        $filter = ['abc124', 'abc123', '123'];
        array_walk(
            $filter,
            function (&$val, $key) {
                $val = preg_replace('|[^0-9]|', '', $val);
            }
        );
        // Should be covered
        $extravar = true;
    }
}