Page::update()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

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