WuBookCorporateFunctions   A
last analyzed

Complexity

Total Complexity 15

Size/Duplication

Total Lines 171
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

14 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A corporate_fetch_accounts() 0 10 2
A corporate_get_providers_info() 0 4 1
A corporate_fetch_channels() 0 4 1
A corporate_get_channels() 0 4 1
A corporate_fetchable_properties() 0 4 1
A corporate_new_property() 0 4 1
A corporate_new_account_and_property() 0 4 1
A corporate_renew_booking() 0 4 1
A corporate_renew_channels() 0 4 1
A corporate_set_autorenew_wb() 0 4 1
A corporate_set_autorenew_wo() 0 4 1
A corporate_balance_transactions() 0 4 1
A corporate_balance_details() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of Laravel WuBook.
5
 *
6
 * (c) Filippo Galante <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace IlGala\LaravelWubook\Api;
13
14
use IlGala\LaravelWubook\Api\WuBookApi;
15
16
/**
17
 * Description of WuBookCorporateFunctions
18
 *
19
 * @author Filippo Galante <[email protected]>
20
 */
21
class WuBookCorporateFunctions extends WuBookApi
22
{
23
24
    /**
25
     * @var string
26
     */
27
    private $token;
28
29
    /**
30
     * Create a new WuBookRooms Instance.
31
     */
32
    public function __construct($config, $cache, $client, $token = null)
33
    {
34
        parent::__construct($config, $cache, $client);
35
36
        $this->token = $token;
37
    }
38
39
    /**
40
     * http://tdocs.wubook.net/wired/corps.html#corporate_fetch_accounts
41
     *
42
     * @param string $acode
43
     * @return mixed
44
     */
45
    public function corporate_fetch_accounts($acode = null)
46
    {
47
        $data = [];
48
49
        if (!empty($acode)) {
50
            array_push($data, $acode);
51
        }
52
53
        return $this->call_method($this->token, 'corporate_fetch_accounts', $data, ['token' => $this->get_token($this->token)]);
0 ignored issues
show
Unused Code introduced by
The call to WuBookCorporateFunctions::call_method() has too many arguments starting with array('token' => $this->get_token($this->token)).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
54
    }
55
56
    /**
57
     * http://tdocs.wubook.net/wired/corps.html#corporate_get_providers_info.
58
     *
59
     * @param array $acodes
60
     * @return mixed
61
     */
62
    public function corporate_get_providers_info($acodes = [])
63
    {
64
        return $this->call_method($this->token, 'corporate_get_providers_info', [$acodes], ['token' => $this->get_token($this->token)]);
0 ignored issues
show
Unused Code introduced by
The call to WuBookCorporateFunctions::call_method() has too many arguments starting with array('token' => $this->get_token($this->token)).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
65
    }
66
67
    /**
68
     * http://tdocs.wubook.net/wired/corps.html#corporate_fetch_channels
69
     *
70
     * @return mixed
71
     */
72
    public function corporate_fetch_channels()
73
    {
74
        return $this->call_method($this->token, 'corporate_fetch_channels');
75
    }
76
77
    /**
78
     * http://tdocs.wubook.net/wired/corps.html#corporate_get_channels
79
     *
80
     * @param array $filters
81
     * @return mixed
82
     */
83
    public function corporate_get_channels($filters = [])
84
    {
85
        return $this->call_method($this->token, 'corporate_get_channels', [$filters]);
86
    }
87
88
    /**
89
     * http://tdocs.wubook.net/wired/corps.html#corporate_fetchable_properties
90
     *
91
     * @return mixed
92
     */
93
    public function corporate_fetchable_properties()
94
    {
95
        return $this->call_method($this->token, 'corporate_fetchable_properties', [], ['token' => $this->get_token($this->token)]);
0 ignored issues
show
Unused Code introduced by
The call to WuBookCorporateFunctions::call_method() has too many arguments starting with array('token' => $this->get_token($this->token)).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
96
    }
97
98
    /**
99
     * http://tdocs.wubook.net/wired/corps.html#corporate_new_property
100
     *
101
     * @param string $lodg
102
     * @param boolean $woodoo_only
103
     * @param string $acode
104
     * @return mixed
105
     */
106
    public function corporate_new_property($lodg, $woodoo_only, $acode)
107
    {
108
        return $this->call_method($this->token, 'corporate_new_property', [$lodg, $woodoo_only, $acode]);
109
    }
110
111
    /**
112
     * http://tdocs.wubook.net/wired/corps.html#corporate_new_account_and_property
113
     *
114
     * @param string $lodg
115
     * @param boolean $woodoo_only
116
     * @param string $acode
117
     * @return mixed
118
     */
119
    public function corporate_new_account_and_property($lodg, $woodoo_only, $acode)
120
    {
121
        return $this->call_method($this->token, 'corporate_new_account_and_property', [$lodg, $woodoo_only, $acode]);
122
    }
123
124
    /**
125
     * http://tdocs.wubook.net/wired/corps.html#corporate_renew_booking
126
     *
127
     * @param string $months
128
     * @param int $pretend
129
     * @return mixed
130
     */
131
    public function corporate_renew_booking($months, $pretend = 1)
132
    {
133
        return $this->call_method($this->token, 'corporate_renew_booking', [$months, $pretend]);
134
    }
135
136
    /**
137
     * http://tdocs.wubook.net/wired/corps.html#corporate_renew_channels
138
     *
139
     * @param array $channels
140
     * @param int $pretend 0|1
141
     * @return mixed
142
     */
143
    public function corporate_renew_channels($channels, $pretend = 1)
144
    {
145
        return $this->call_method($this->token, 'corporate_renew_channels', [$channels, $pretend]);
146
    }
147
148
    /**
149
     * http://tdocs.wubook.net/wired/corps.html#corporate_set_autorenew_wb
150
     *
151
     * @param integer $v 0|1
152
     * @return mixed
153
     */
154
    public function corporate_set_autorenew_wb($v)
155
    {
156
        return $this->call_method($this->token, 'corporate_set_autorenew_wb', [$v]);
157
    }
158
159
    /**
160
     * http://tdocs.wubook.net/wired/corps.html#corporate_set_autorenew_wo
161
     *
162
     * @param array $lchans
163
     * @param int $v 0|1
164
     * @return mixed
165
     */
166
    public function corporate_set_autorenew_wo($lchans, $v)
167
    {
168
        return $this->call_method($this->token, 'corporate_set_autorenew_wo', [$lchans, $v]);
169
    }
170
171
    /**
172
     * http://tdocs.wubook.net/wired/corps.html#corporate_balance_transactions
173
     *
174
     * @return mixed
175
     */
176
    public function corporate_balance_transactions()
177
    {
178
        return $this->call_method($this->token, 'corporate_balance_transactions', [], ['token' => $this->get_token($this->token)]);
0 ignored issues
show
Unused Code introduced by
The call to WuBookCorporateFunctions::call_method() has too many arguments starting with array('token' => $this->get_token($this->token)).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
179
    }
180
181
    /**
182
     * http://tdocs.wubook.net/wired/corps.html#corporate_balance_details
183
     *
184
     * @param int $transactionId
185
     * @return mixed
186
     */
187
    public function corporate_balance_details($transactionId)
188
    {
189
        return $this->call_method($this->token, 'corporate_balance_details', [$transactionId], ['token' => $this->get_token($this->token)]);
0 ignored issues
show
Unused Code introduced by
The call to WuBookCorporateFunctions::call_method() has too many arguments starting with array('token' => $this->get_token($this->token)).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
190
    }
191
}
192