Starter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A start() 0 15 4
1
<?php
2
3
namespace Consigliere\Components;
4
5
use Illuminate\Filesystem\Filesystem;
6
use Symfony\Component\Finder\Finder;
7
8
class Starter
9
{
10
    /**
11
     * Load the workbench vendor auto-load files.
12
     *
13
     * @param string $path
14
     * @param \Symfony\Component\Finder\Finder $finder
15
     * @param \Illuminate\Filesystem\Filesystem $files
16
     */
17
    public static function start($path, Finder $finder = null, Filesystem $files = null)
18
    {
19
        $finder = $finder ?: new Finder();
20
21
        // We will use the finder to locate all "autoload.php" files in the workbench
22
        // directory, then we will include them each so that they are able to load
23
        // the appropriate classes and file used by the given workbench package.
24
        $files = $files ?: new Filesystem();
25
26
        $autoloads = $finder->in($path)->files()->name('autoload.php')->depth('<= 3')->followLinks();
27
28
        foreach ($autoloads as $file) {
29
            $files->requireOnce($file->getRealPath());
30
        }
31
    }
32
}
33