DisqusServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 10
c 2
b 0
f 0
dl 0
loc 43
ccs 0
cts 21
cp 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 2 1
A publishConfig() 0 7 1
A boot() 0 5 1
A registerMiddleware() 0 4 1
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