Completed
Push — master ( 5ba622...a793ea )
by David
14:14
created

ModuleServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 33
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 13 3
A register() 0 4 1
1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Filesystem\Filesystem;
6
use Illuminate\Support\ServiceProvider;
7
8
class ModuleServiceProvider extends ServiceProvider
9
{
10
    protected $files;
11
12
    /**
13
     * Bootstrap the application services.
14
     *
15
     * @return void
16
     */
17
    public function boot()
18
    {
19
        $modules = $this->files->directories(app_path() . '/LaravelRestCms/Modules');
20
21
        foreach ($modules as $module)  {
22
            
23
            $route = $module . '/routes.php';
24
25
            if ($this->files->exists($route)) {
26
                require $route;
27
            }
28
        }
29
    }
30
31
    /**
32
     * Register the application services.
33
     *
34
     * @return void
35
     */
36
    public function register()
37
    {
38
        $this->files = new Filesystem;
39
    }
40
}
41