ContainsInlineData   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 16
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A filter() 0 10 3
1
<?php
2
namespace Aoe\Asdis\System\Uri\Filter;
3
4
use Aoe\Asdis\System\Uri\Filter\FilterInterface;
5
6
/**
7
 * Filters paths that start with "data:".
8
 */
9
class ContainsInlineData implements FilterInterface
10
{
11
    /**
12
     * @param array $paths Array of paths.
13
     * @return array Valid paths.
14
     */
15 1
    public function filter(array $paths)
16
    {
17 1
        $filteredPaths = [];
18 1
        foreach ($paths as $path) {
19 1
            if (0 === strpos($path, 'data:')) {
20 1
                continue;
21
            }
22 1
            $filteredPaths[] = $path;
23
        }
24 1
        return $filteredPaths;
25
    }
26
}