Paths   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAbsFilePaths() 0 19 4
1
<?php
2
3
namespace Imanghafoori\LaravelMicroscope\FileReaders;
4
5
use Symfony\Component\Finder\Exception\DirectoryNotFoundException;
6
use Symfony\Component\Finder\Finder;
7
8
class Paths
9
{
10
    public static function getAbsFilePaths($dirs)
11
    {
12
        if (! $dirs) {
13
            return [];
14
        }
15
16
        try {
17
            $files = Finder::create()->files()->name('*.php')->in($dirs);
18
19
            $paths = [];
20
            foreach ($files as $f) {
21
                $paths[] = $f->getRealPath();
22
            }
23
24
            return $paths;
25
        } catch (DirectoryNotFoundException $e) {
26
            return [];
27
        }
28
    }
29
}
30