Page   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 24
c 2
b 0
f 0
dl 0
loc 49
ccs 29
cts 29
cp 1
rs 10
wmc 5

5 Methods

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