Completed
Push — master ( ce66b6...f0706c )
by Ibrahim
14:07
created

Subaccount   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 114
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 114
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A root() 0 4 1
A create() 0 14 1
A fetch() 0 8 1
A getList() 0 5 1
A update() 0 15 1
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 Subaccount implements RouteInterface
22
{
23
24
    /**
25
      Root
26
     */
27
    public static function root()
28
    {
29
        return '/subaccount';
30
    }
31
    /*
32
      Create subaccount
33
     */
34
35
    /**
36
     * create
37
     * Insert description here
38
     *
39
     * @return
40
     *
41
     * @access
42
     * @static
43
     * @see
44
     * @since
45
     */
46
    public static function create()
47
    {
48
        return [
49
            RouteInterface::METHOD_KEY   => RouteInterface::POST_METHOD,
50
            RouteInterface::ENDPOINT_KEY => Page::root(),
51
            RouteInterface::PARAMS_KEY   => [
52
                'business_name', 'settlement_bank',
53
                'account_number','percentage_charge',
54
                'primary_contact_email','primary_contact_name',
55
                'primary_contact_phone',
56
                'metadata','settlement_schedule',
57
                ]
58
        ];
59
    }
60
    /*
61
      Get subaccount
62
     */
63
64
    /**
65
     * fetch
66
     * Insert description here
67
     *
68
     * @return
69
     *
70
     * @access
71
     * @static
72
     * @see
73
     * @since
74
     */
75
    public static function fetch()
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...
76
    {
77
        return [
78
            RouteInterface::METHOD_KEY   => RouteInterface::GET_METHOD,
79
            RouteInterface::ENDPOINT_KEY => Page::root() . '/{id}',
80
            RouteInterface::ARGS_KEY     => ['id' ]
81
        ];
82
    }
83
84
    /*
85
      List page
86
     */
87
88
    /**
89
     * getList
90
     * Insert description here
91
     *
92
     * @return
93
     *
94
     * @access
95
     * @static
96
     * @see
97
     * @since
98
     */
99
    public static function getList()
100
    {
101
        return [RouteInterface::METHOD_KEY   => RouteInterface::GET_METHOD,
102
            RouteInterface::ENDPOINT_KEY => Page::root() ];
103
    }
104
    /*
105
      Update page
106
     */
107
108
    /**
109
     * update
110
     * Insert description here
111
     *
112
     * @return
113
     *
114
     * @access
115
     * @static
116
     * @see
117
     * @since
118
     */
119
    public static function update()
120
    {
121
        return [
122
            RouteInterface::METHOD_KEY   => RouteInterface::PUT_METHOD,
123
            RouteInterface::ENDPOINT_KEY => Page::root() . '/{id}',
124
            RouteInterface::PARAMS_KEY   => [
125
                'business_name', 'settlement_bank',
126
                'account_number','percentage_charge',
127
                'primary_contact_email','primary_contact_name',
128
                'primary_contact_phone',
129
                'metadata','settlement_schedule' 
130
            ],
131
            RouteInterface::ARGS_KEY     => ['id' ]
132
        ];
133
    }
134
}
135