OmnipayServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 25
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 8 1
1
<?php
2
3
namespace DansMaCulotte\Omnipay;
4
5
use Illuminate\Support\ServiceProvider;
6
use Omnipay\Common\GatewayFactory;
7
use Omnipay\Omnipay;
8
9
class OmnipayServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14
    public function boot()
15
    {
16
        $this->mergeConfigFrom(__DIR__.'/../config/omnipay.php', 'omnipay');
17
18
        $this->publishes([
19
            __DIR__.'/../config/omnipay.php' => config_path('omnipay.php'),
20
        ]);
21
    }
22
23
    /**
24
     * Register the service provider.
25
     */
26
    public function register()
27
    {
28
        $this->app->singleton(Omnipay::class, function ($app) {
29
            $defaults = config('omnipay.defaults', []);
30
            return new OmnipayGatewayManager($app, new GatewayFactory, $defaults);
31
        });
32
33
        $this->app->alias(Omnipay::class, 'omnipay');
34
    }
35
}
36