JazzCMSServiceProvider::publishConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace NsTechNs\JazzCMS;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class JazzCMSServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $configPath = __DIR__ . '/../config/jazz-cms.php';
17
        $this->publishes([$configPath => $this->getConfigPath()], 'config');
18
    }
19
20
    /**
21
     * Register the application services.
22
     *
23
     * @return void
24
     */
25
    public function register()
26
    {
27
        $configPath = __DIR__ . '/../config/jazz-cms.php';
28
        $this->mergeConfigFrom($configPath, 'jazz-cms');
29
30
        $this->app->bind(JazzCMS::class, function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

30
        $this->app->bind(JazzCMS::class, function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
31
            return new JazzCMS;
32
        });
33
34
        $this->app->alias(JazzCMS::class, 'JazzCMS');
35
    }
36
37
    /**
38
     * Get the config path
39
     *
40
     * @return string
41
     */
42
    protected function getConfigPath()
43
    {
44
        return config_path('jazz-cms.php');
45
    }
46
47
    /**
48
     * Publish the config file
49
     *
50
     * @param  string $configPath
51
     */
52
    protected function publishConfig($configPath)
53
    {
54
        $this->publishes([$configPath => config_path('jazz-cms.php')], 'config');
55
    }
56
}
57