Completed
Push — master ( bb3faf...1c3da6 )
by Ibrahim
13:51
created

Page::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 9
Ratio 100 %
Metric Value
dl 9
loc 9
rs 9.6666
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace Yabacon\Paystack\Routes;
4
5
use Yabacon\Paystack\Contracts\RouteInterface;
6
7
/**
8
 * Page
9
 * Insert description here
10
 *
11
 * @category
12
 * @package
13
 * @author
14
 * @copyright
15
 * @license
16
 * @version
17
 * @link
18
 * @see
19
 * @since
20
 */
21
class Page implements RouteInterface
22
{
23
24
    /**
25
      Root
26
     */
27
    public static function root()
28
    {
29
        return '/page';
30
    }
31
    /*
32
      Create page
33
     */
34
35
    /**
36
     * create
37
     * Insert description here
38
     *
39
     * @return
40
     *
41
     * @access
42
     * @static
43
     * @see
44
     * @since
45
     */
46 View Code Duplication
    public static function create()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
47
    {
48
        return [RouteInterface::METHOD_KEY   => RouteInterface::POST_METHOD,
49
            RouteInterface::ENDPOINT_KEY => Page::root(),
50
            RouteInterface::PARAMS_KEY   => [
51
                'name',
52
                'description',
53
                'amount' ]
54
        ];
55
    }
56
    /*
57
      Get page
58
     */
59
60
    /**
61
     * fetch
62
     * Insert description here
63
     *
64
     * @return
65
     *
66
     * @access
67
     * @static
68
     * @see
69
     * @since
70
     */
71
    public static function fetch()
72
    {
73
        return [RouteInterface::METHOD_KEY   => RouteInterface::GET_METHOD,
74
            RouteInterface::ENDPOINT_KEY => Page::root() . '/{id}',
75
            RouteInterface::ARGS_KEY     => ['id' ] ];
76
    }
77
78
    /*
79
      List page
80
     */
81
82
    /**
83
     * getList
84
     * Insert description here
85
     *
86
     * @return
87
     *
88
     * @access
89
     * @static
90
     * @see
91
     * @since
92
     */
93
    public static function getList()
94
    {
95
        return [RouteInterface::METHOD_KEY   => RouteInterface::GET_METHOD,
96
            RouteInterface::ENDPOINT_KEY => Page::root() ];
97
    }
98
    /*
99
      Update page
100
     */
101
102
    /**
103
     * update
104
     * Insert description here
105
     *
106
     * @return
107
     *
108
     * @access
109
     * @static
110
     * @see
111
     * @since
112
     */
113 View Code Duplication
    public static function update()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
114
    {
115
        return [RouteInterface::METHOD_KEY   => RouteInterface::PUT_METHOD,
116
            RouteInterface::ENDPOINT_KEY => Page::root() . '/{id}',
117
            RouteInterface::PARAMS_KEY   => [
118
                'name',
119
                'description' ],
120
            RouteInterface::ARGS_KEY     => ['id' ] ];
121
    }
122
}
123