Completed
Push — master ( 6188f9...65fb0e )
by Christian
02:17
created

FullChangeSet   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 25
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 17 2
1
<?php
2
3
namespace uuf6429\ElderBrother\Change;
4
5
use Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator;
6
7
class FullChangeSet
8
{
9
    /**
10
     * @param string|null Starting directory (current working dir is used if null)
11
     *
12
     * @return FileList
13
     */
14 13
    public static function get($dir = null)
15
    {
16 13
        $dir = is_null($dir) ? getcwd() : $dir;
0 ignored issues
show
Coding Style introduced by
Consider using a different name than the parameter $dir. This often makes code more readable.
Loading history...
17
18 13
        return new FileList(
19 13
            __METHOD__ . '()',
20 13
            function () use ($dir) {
21 13
                return new \RecursiveIteratorIterator(
22 13
                    new RecursiveDirectoryIterator(
23
                        $dir,
24 13
                        RecursiveDirectoryIterator::SKIP_DOTS
25
                    ),
26 13
                    \RecursiveIteratorIterator::CHILD_FIRST
27
                );
28 13
            }
29
        );
30
    }
31
}
32