Completed
Push — master ( 352cb5...fa12f0 )
by Action
04:25
created

UnitPayServiceProvider::testingEnv()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 16
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.2
c 0
b 0
f 0
cc 4
eloc 8
nc 4
nop 0
1
<?php
2
3
namespace ActionM\UnitPay;
4
5
use Illuminate\Support\Facades\App;
6
use Illuminate\Support\ServiceProvider;
7
use ActionM\UnitPay\Exceptions\InvalidConfiguration;
8
9
class UnitPayServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14
    public function boot()
15
    {
16
        $this->publishes([
17
            __DIR__.'/../config/unitpay.php' => config_path('unitpay.php'),
18
        ], 'config');
19
20
        $this->publishes([
21
            __DIR__.'/../resources/views' => base_path('resources/views/vendor/unitpay'),
22
        ], 'views');
23
24
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'unitpay');
25
26
    }
27
28
    /**
29
     * Register the application services.
30
     */
31
    public function register()
32
    {
33
        $this->mergeConfigFrom(__DIR__.'/../config/unitpay.php', 'unitpay');
34
35
        $this->app['events']->subscribe(UnitPayNotifier::class);
36
37
        $this->app->singleton('unitpay', function () {
38
            return $this->app->make('ActionM\UnitPay\UnitPay');
39
        });
40
41
        $this->app->alias('unitpay', 'UnitPay');
42
43
        $this->app->singleton(UnitPayNotifier::class);
44
    }
45
}
46