LaravelExceptionNotifier   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 3
eloc 16
c 3
b 1
f 0
dl 0
loc 56
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A publishFiles() 0 18 1
A register() 0 5 1
A boot() 0 2 1
1
<?php
2
3
namespace jeremykenedy\laravelexceptionnotifier;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class LaravelExceptionNotifier extends ServiceProvider
8
{
9
    private $_packageTag = 'laravelexceptionnotifier';
10
11
    /**
12
     * Indicates if loading of the provider is deferred.
13
     *
14
     * @var bool
15
     */
16
    protected $defer = false;
17
18
    /**
19
     * Bootstrap the application services.
20
     *
21
     * @return void
22
     */
23
    public function boot()
24
    {
25
        //
26
    }
27
28
    /**
29
     * Register the application services.
30
     *
31
     * @return void
32
     */
33
    public function register()
34
    {
35
        $this->loadViewsFrom(__DIR__.'/resources/views/', $this->_packageTag);
36
        $this->mergeConfigFrom(__DIR__.'/config/exceptions.php', $this->_packageTag);
37
        $this->publishFiles();
38
    }
39
40
    /**
41
     * Publish files for package.
42
     *
43
     * @return void
44
     */
45
    private function publishFiles()
46
    {
47
        $publishTag = $this->_packageTag;
48
49
        // Publish Mailer
50
        $this->publishes([
51
            __DIR__.'/App/Mail/ExceptionOccured.php' => app_path('Mail/ExceptionOccured.php'),
52
        ], $publishTag);
53
54
        // Publish email view
55
        $this->publishes([
56
            __DIR__.'/resources/views/emails/exception.blade.php' => resource_path('views/emails/exception.blade.php'),
57
        ], $publishTag);
58
59
        // Publish config file
60
        $this->publishes([
61
            __DIR__.'/config/exceptions.php' => config_path('exceptions.php'),
62
        ], $publishTag);
63
    }
64
}
65