Passed
Pull Request — master (#5)
by Samuel
02:12
created

JsonHandlerServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A configPath() 0 3 1
A boot() 0 10 1
1
<?php
2
3
namespace SMartins\Exceptions;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class JsonHandlerServiceProvider extends ServiceProvider
8
{
9
    public function boot()
10
    {
11
        $this->publishes([
12
            $this->configPath() => config_path('json-exception-handler.php'),
13
        ]);
14
15
        $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'exception');
16
17
        $this->publishes([
18
            __DIR__.'/../resources/lang' => resource_path('lang/vendor/exception'),
19
        ]);
20
    }
21
22
    public function register()
23
    {
24
        $this->mergeConfigFrom($this->configPath(), 'json-exception-handler');
25
    }
26
27
    public function configPath()
28
    {
29
        return __DIR__.'/../config/json-exception-handler.php';
30
    }
31
}
32