Subscription   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 28
c 0
b 0
f 0
dl 0
loc 58
ccs 34
cts 34
cp 1
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A root() 0 3 1
A fetch() 0 6 1
A enable() 0 8 1
A disable() 0 8 1
A getList() 0 5 1
A create() 0 9 1
1
<?php
2
3
namespace Yabacon\Paystack\Routes;
4
5
use Yabacon\Paystack\Contracts\RouteInterface;
6
7
class Subscription implements RouteInterface
8
{
9
10 3
    public static function root()
11
    {
12 3
        return '/subscription';
13
    }
14
15 2
    public static function create()
16
    {
17
        return [
18 2
            RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD,
19 2
            RouteInterface::ENDPOINT_KEY => Subscription::root(),
20 2
            RouteInterface::PARAMS_KEY => [
21 2
                'customer',
22 2
                'plan',
23 2
                'authorization',
24 2
            ],
25 2
        ];
26
    }
27
28 2
    public static function fetch()
29
    {
30
        return [
31 2
            RouteInterface::METHOD_KEY => RouteInterface::GET_METHOD,
32 2
            RouteInterface::ENDPOINT_KEY => Subscription::root() . '/{id}',
33 2
            RouteInterface::ARGS_KEY => ['id'],
34 2
        ];
35
    }
36
37 2
    public static function getList()
38
    {
39
        return [
40 2
            RouteInterface::METHOD_KEY => RouteInterface::GET_METHOD,
41 2
            RouteInterface::ENDPOINT_KEY => Subscription::root(),
42 2
        ];
43
    }
44
45 2
    public static function disable()
46
    {
47
        return [
48 2
            RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD,
49 2
            RouteInterface::ENDPOINT_KEY => Subscription::root() . '/disable',
50 2
            RouteInterface::PARAMS_KEY => [
51 2
                'code',
52 2
                'token',
53 2
            ],
54 2
        ];
55
    }
56
57 2
    public static function enable()
58
    {
59
        return [
60 2
            RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD,
61 2
            RouteInterface::ENDPOINT_KEY => Subscription::root() . '/enable',
62 2
            RouteInterface::PARAMS_KEY => [
63 2
                'code',
64 2
                'token',
65 2
            ],
66 2
        ];
67
    }
68
}
69