Plan::getList()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Yabacon\Paystack\Routes;
4
5
use Yabacon\Paystack\Contracts\RouteInterface;
6
7
class Plan implements RouteInterface
8
{
9
10 3
    public static function root()
11
    {
12 3
        return '/plan';
13
    }
14
15 2
    public static function create()
16
    {
17
        return [
18 2
            RouteInterface::METHOD_KEY => RouteInterface::POST_METHOD,
19 2
            RouteInterface::ENDPOINT_KEY => Plan::root(),
20 2
            RouteInterface::PARAMS_KEY => [
21 2
                'name',
22 2
                'description',
23 2
                'amount',
24 2
                'interval',
25 2
                'send_invoices',
26 2
                'send_sms',
27 2
                'hosted_page',
28 2
                'hosted_page_url',
29 2
                'hosted_page_summary',
30 2
                'currency',
31 2
            ],
32 2
        ];
33
    }
34
35 2
    public static function fetch()
36
    {
37
        return [
38 2
            RouteInterface::METHOD_KEY => RouteInterface::GET_METHOD,
39 2
            RouteInterface::ENDPOINT_KEY => Plan::root() . '/{id}',
40 2
            RouteInterface::ARGS_KEY => ['id'],
41 2
        ];
42
    }
43
44 2
    public static function getList()
45
    {
46
        return [
47 2
            RouteInterface::METHOD_KEY => RouteInterface::GET_METHOD,
48 2
            RouteInterface::ENDPOINT_KEY => Plan::root(),
49 2
        ];
50
    }
51
52 2
    public static function update()
53
    {
54
        return [
55 2
            RouteInterface::METHOD_KEY => RouteInterface::PUT_METHOD,
56 2
            RouteInterface::ENDPOINT_KEY => Plan::root() . '/{id}',
57 2
            RouteInterface::PARAMS_KEY => [
58 2
                'name',
59 2
                'description',
60 2
                'amount',
61 2
                'interval',
62 2
                'send_invoices',
63 2
                'send_sms',
64 2
                'hosted_page',
65 2
                'hosted_page_url',
66 2
                'hosted_page_summary',
67 2
                'currency',
68 2
            ],
69 2
            RouteInterface::ARGS_KEY => ['id'],
70 2
        ];
71
    }
72
}
73