Completed
Pull Request — master (#333)
by
unknown
59:20
created

Module   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCachedServicesPath() 0 4 1
A registerProviders() 0 5 1
1
<?php
2
3
namespace Nwidart\Modules\Laravel;
4
5
use Illuminate\Filesystem\Filesystem;
6
use Illuminate\Foundation\ProviderRepository;
7
use Illuminate\Support\Str;
8
use Nwidart\Modules\Module as BaseModule;
9
10
class Module extends BaseModule
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15 3
    public function getCachedServicesPath()
16
    {
17 3
        return Str::replaceLast('services.php', $this->getSnakeName() . '_module.php', $this->app->getCachedServicesPath());
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23 2
    public function registerProviders()
24
    {
25 2
        (new ProviderRepository($this->app, new Filesystem(), $this->getCachedServicesPath()))
26 2
            ->load($this->get('providers', []));
27 2
    }
28
}
29