PayPalFacadeAccessor::getProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Srmklive\PayPal;
4
5
use Exception;
6
use Srmklive\PayPal\Services\PayPal as PayPalClient;
7
8
class PayPalFacadeAccessor
9
{
10
    /**
11
     * PayPal API provider object.
12
     *
13
     * @var
14
     */
15
    public static $provider;
16
17
    /**
18
     * Get specific PayPal API provider object to use.
19
     *
20
     * @throws Exception
21
     *
22
     * @return \Srmklive\PayPal\Services\PayPal
23
     */
24
    public static function getProvider()
25
    {
26
        return self::$provider;
27
    }
28
29
    /**
30
     * Set PayPal API Client to use.
31
     *
32
     * @throws \Exception
33
     *
34
     * @return \Srmklive\PayPal\Services\PayPal
35
     */
36
    public static function setProvider()
37
    {
38
        // Set default provider. Defaults to ExpressCheckout
39
        self::$provider = new PayPalClient();
40
41
        return self::getProvider();
42
    }
43
}
44