Lines 100.00% 8 / 8
Functions and Methods 100.00% 1 / 1
Classes and Traits 100.00% 1 / 1
Covered by tests of size
Name Lines Functions and Methods CRAP Classes and Traits
CoveredClassWithAnonymousFunctionInStaticMethod 100.00% 8 / 8 100.00% 1 / 1 1 100.00% 1 / 1
 runAnonymous 100.00% 8 / 8 100.00% 1 / 1 1
1<?php
2
3class CoveredClassWithAnonymousFunctionInStaticMethod
4{
5    public static function runAnonymous()
6    {
7        $filter = ['abc124', 'abc123', '123'];
8
9        array_walk(
10            $filter,
11            function (&$val, $key) {
12                $val = preg_replace('|[^0-9]|', '', $val);
13            }
14        );
15
16        // Should be covered
17        $extravar = true;
18    }
19}