DisqusServiceProvider::publishConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 7
ccs 0
cts 7
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Yajra\Disqus;
4
5
use Illuminate\Contracts\Http\Kernel;
6
use Illuminate\Support\ServiceProvider;
7
8
class DisqusServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap any application services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        $this->publishConfig();
18
19
        $this->registerMiddleware();
20
    }
21
22
    /**
23
     * Register and publish the config.
24
     */
25
    protected function publishConfig()
26
    {
27
        $path = __DIR__.'/../config/disqus.php';
28
        $this->mergeConfigFrom($path, 'disqus');
29
        $this->publishes([
30
            $path => config_path('disqus.php'),
0 ignored issues
show
Bug introduced by
The function config_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

30
            $path => /** @scrutinizer ignore-call */ config_path('disqus.php'),
Loading history...
31
        ], 'disqus');
32
    }
33
34
    /**
35
     * Register disqus middleware.
36
     */
37
    protected function registerMiddleware()
38
    {
39
        $this->app[Kernel::class]->pushMiddleware(
40
            DisqusMiddleware::class
41
        );
42
    }
43
44
    /**
45
     * Register any application services.
46
     *
47
     * @return void
48
     */
49
    public function register()
50
    {
51
        //
52
    }
53
}
54