Code Duplication    Length = 7-7 lines in 2 locations

src/Gabrieljmj/Should/Runner/DirectoryRunner.php 1 location

@@ 50-56 (lines=7) @@
47
            $path = realpath($dir);
48
            $entries = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::SELF_FIRST);
49
50
            foreach ($entries as $key => $name) {
51
                $files[$key] = $name;
52
                $e = explode('\\', $name);
53
                if (end($e) === '.' || end($e) === '..' || is_dir($name)) {
54
                    unset($files[$key]);
55
                }
56
            }
57
        }
58
59
        $ambients = ['files' => [], 'classes' => []];

src/Gabrieljmj/Should/Runner/Rule/Directory/AbstractDirectoryRule.php 1 location

@@ 33-39 (lines=7) @@
30
        $entries = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::SELF_FIRST);
31
        $files = [];
32
33
        foreach ($entries as $key => $name) {
34
            $files[$key] = $name;
35
            $e = explode('\\', $name);
36
            if (end($e) === '.' || end($e) === '..' || is_dir($name) || !$this->appliesTheRule($name)) {
37
                unset($files[$key]);
38
            }
39
        }
40
41
        return $files;
42
    }