Completed
Push — master ( 2ca05d...6b4c2a )
by Nicolas
03:24
created

LumenModulesServiceProvider::setupStubPath()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 8
ccs 0
cts 7
cp 0
crap 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Nwidart\Modules;
4
5
use Nwidart\Modules\Support\Stub;
6
7
class LumenModulesServiceProvider extends ModulesServiceProvider
8
{
9
    /**
10
     * Booting the package.
11
     */
12
    public function boot()
13
    {
14
        $this->setupStubPath();
15
    }
16
17
    /**
18
     * Register all modules.
19
     */
20
    public function register()
21
    {
22
        $this->registerNamespaces();
23
        $this->registerServices();
24
        $this->registerModules();
25
        $this->registerProviders();
26
    }
27
28
    /**
29
     * Setup stub path.
30
     */
31
    public function setupStubPath()
32
    {
33
        Stub::setBasePath(__DIR__ . '/Commands/stubs');
34
35
        if (app('modules')->config('stubs.enabled') === true) {
36
            Stub::setBasePath(app('modules')->config('stubs.path'));
37
        }
38
    }
39
}
40