Completed
Pull Request — master (#1151)
by
unknown
11:34 queued 01:35
created

Module::getLaravel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
cc 1
nc 1
nop 0
rs 10
ccs 0
cts 3
cp 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Nwidart\Modules\Laravel;
5
6
use Illuminate\Filesystem\Filesystem;
7
use Illuminate\Foundation\AliasLoader;
8
use Illuminate\Foundation\ProviderRepository;
9
use Illuminate\Support\Str;
10
use Nwidart\Modules\Module as BaseModule;
11
12
class Module extends BaseModule
13
{
14
    /**
15
     * {@inheritdoc}
16 3
     */
17
    public function getCachedServicesPath(): string
18
    {
19
        return Str::replaceLast('services.php', $this->getSnakeName() . '_module.php', $this->app->getCachedServicesPath());
20 3
    }
21
22
    /**
23
     * {@inheritdoc}
24 3
     */
25
    public function registerProviders(): void
26
    {
27
        (new ProviderRepository($this->app, new Filesystem(), $this->getCachedServicesPath()))
28
            ->load($this->get('providers', []));
29
    }
30 2
31
    /**
32 2
     * {@inheritdoc}
33 2
     */
34 2
    public function registerAliases(): void
35
    {
36
        $loader = AliasLoader::getInstance();
37
        foreach ($this->get('aliases', []) as $aliasName => $aliasClass) {
38
            $loader->alias($aliasName, $aliasClass);
39
        }
40
    }
41
42
    public function getLaravel()
43
    {
44
        // TODO: Implement getLaravel() method.
45
    }
46
47
    public function enabled(): bool
48
    {
49
        // TODO: Implement enabled() method.
50
    }
51
52
    public function disabled(): bool
53
    {
54
        // TODO: Implement disabled() method.
55
    }
56
}
57