Subscription::fetch()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
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