ChargifyFacadeAccessor   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setProvider() 0 6 1
A getProvider() 0 3 1
1
<?php
2
3
namespace Srmklive\Chargify;
4
5
use Exception;
6
use Srmklive\Chargify\Services\Chargify as ChargifyClient;
7
8
class ChargifyFacadeAccessor
9
{
10
    /**
11
     * Chargify API provider object.
12
     *
13
     * @var
14
     */
15
    public static $provider;
16
17
    /**
18
     * Get Chargify API provider object to use.
19
     *
20
     * @throws Exception
21
     *
22
     * @return \Srmklive\Chargify\Services\Chargify
23
     */
24
    public static function getProvider()
25
    {
26
        return self::$provider;
27
    }
28
29
    /**
30
     * Set Chargify API Client to use.
31
     *
32
     * @throws \Exception
33
     *
34
     * @return \Srmklive\Chargify\Services\Chargify
35
     */
36
    public static function setProvider()
37
    {
38
        // Set default provider.
39
        self::$provider = new ChargifyClient();
40
41
        return self::getProvider();
42
    }
43
}
44