KNetServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 2
A register() 0 4 1
1
<?php
2
3
namespace DeveloperH\Knet\Providers;
4
5
use DeveloperH\Knet\Services\KNet;
6
use Illuminate\Support\ServiceProvider;
7
8
class KNetServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Register services.
12
     *
13
     * @return void
14
     */
15
    public function register()
16
    {
17
        $this->app->bind('knet', function () {
18
            return new KNet();
19
        });
20
    }
21
22
    /**
23
     * Bootstrap services.
24
     *
25
     * @return void
26
     */
27
    public function boot()
28
    {
29
        $this->publishes([
30
           __DIR__.'/../../config' => realpath('config'),
31
        ], 'knet-payment');
32
33
        if (null === $this->app['config']->get('kent.php')) {
34
            $this->app['config']->set('knet', require __DIR__.'/../../config/knet.php');
35
        }
36
        $this->mergeConfigFrom(__DIR__.'/../../config/knet.php', 'knet-payment');
37
38
        $this->loadRoutesFrom(__DIR__.'/../../routes/web.php');
39
    }
40
}
41