Passed
Pull Request — main (#123)
by Andrey
27:30 queued 12:28
created

ServiceProvider::isLumen()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/*
4
 * This file is part of the "andrey-helldar/laravel-lang-publisher" project.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @author Andrey Helldar <[email protected]>
10
 *
11
 * @copyright 2021 Andrey Helldar
12
 *
13
 * @license MIT
14
 *
15
 * @see https://github.com/andrey-helldar/laravel-lang-publisher
16
 */
17
18
declare(strict_types=1);
19
20
namespace Helldar\LaravelLangPublisher;
21
22
use Helldar\LaravelLangPublisher\Console\Add;
23
use Helldar\LaravelLangPublisher\Console\Remove;
24
use Helldar\LaravelLangPublisher\Console\Reset;
25
use Helldar\LaravelLangPublisher\Console\Update;
26
use Helldar\LaravelLangPublisher\Constants\Config;
27
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
28
29
class ServiceProvider extends BaseServiceProvider
30
{
31
    public function boot(): void
32
    {
33
        $this->bootPublishes();
34
        $this->bootCommands();
35
    }
36
37
    public function register(): void
38
    {
39
        $this->config();
40
    }
41
42
    protected function bootCommands(): void
43
    {
44
        $this->commands([
45
            Add::class,
46
            Reset::class,
47
            Remove::class,
48
            Update::class,
49
        ]);
50
    }
51
52
    protected function bootPublishes(): void
53
    {
54
        $this->publishes([
55
            __DIR__ . '/../config/public.php' => $this->app->configPath(Config::PUBLIC_KEY . '.php'),
56
        ], 'config');
57
    }
58
59
    protected function config(): void
60
    {
61
        $this->mergeConfigFrom(__DIR__ . '/../config/public.php', Config::PUBLIC_KEY);
62
        $this->mergeConfigFrom(__DIR__ . '/../config/private.php', Config::PRIVATE_KEY);
63
    }
64
}
65