DirectoryFilter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFiles() 0 9 1
1
<?php
2
3
class DirectoryFilter
4
{
5
    /**
6
     * @param string $directory
7
     * @param string $ext
8
     * @return array
9
     */
10
    public function getFiles($directory, $ext)
11
    {
12
        return array_filter(
13
            scandir($directory),
14
            function ($file) use ($ext) {
15
                return pathinfo($file, PATHINFO_EXTENSION) === $ext;    
16
            }
17
        );
18
    }
19
}
20