Passed
Pull Request — master (#9)
by Darío
03:17
created

PayPalServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 4
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Pleets\LaravelPayPal\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use PaymentGateway\PayPalSdk\PayPalService;
7
use Pleets\LaravelPayPal\Helpers\Environment;
8
9
class PayPalServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register services.
13
     *
14
     * @return void
15
     */
16
    public function register()
17
    {
18
        $this->app->bind(PayPalService::class, function () {
19
            $paypalService = new PayPalService(Environment::getEndpoint());
20
            $paypalService->setAuth(Environment::getClientId(), Environment::getSecret());
21
            return $paypalService;
22
        });
23
    }
24
}
25