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

Module::getCachedServicesPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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