WuBookReservations::new_reservation()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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 WuBookReservations
18
 *
19
 * @author Filippo Galante <[email protected]>
20
 */
21
class WuBookReservations 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/fetch.html#push_activation
41
     *
42
     * @param string $url
43
     * @param int $test
44
     * @return mixed
45
     */
46
    public function push_activation($url, $test = 0)
47
    {
48
        return $this->call_method($this->token, 'push_activation', [$url, $test]);
49
    }
50
51
    /**
52
     * http://tdocs.wubook.net/wired/fetch.html#push_url
53
     *
54
     * @return mixed
55
     */
56
    public function push_url()
57
    {
58
        return $this->call_method($this->token, 'push_url');
59
    }
60
61
    /**
62
     * http://tdocs.wubook.net/wired/fetch.html#fetch_new_bookings
63
     *
64
     * @param int $ancillary
65
     * @param int $mark
66
     * @return mixed
67
     */
68
    public function fetch_new_bookings($ancillary = 0, $mark = 1)
69
    {
70
        return $this->call_method($this->token, 'fetch_new_bookings', [$ancillary, $mark]);
71
    }
72
73
    /**
74
     * http://tdocs.wubook.net/wired/fetch.html#mark_bookings
75
     *
76
     * @param array $reservations
77
     * @return mixed
78
     */
79
    public function mark_bookings($reservations = [])
80
    {
81
        return $this->call_method($this->token, 'mark_bookings', [$reservations]);
82
    }
83
84
    /**
85
     * http://tdocs.wubook.net/wired/fetch.html#fetch_bookings
86
     *
87
     * @param string $dfrom
88
     * @param string $dto
89
     * @param int $oncreated
90
     * @param int $ancillary
91
     * @return mixed
92
     */
93
    public function fetch_bookings($dfrom = '', $dto = '', $oncreated = 1, $ancillary = 0)
94
    {
95
        return $this->call_method($this->token, 'fetch_bookings', [$dfrom, $dto, $oncreated, $ancillary]);
96
    }
97
98
    /**
99
     * http://tdocs.wubook.net/wired/fetch.html#fetch_bookings_codes
100
     *
101
     * @param string $dfrom
102
     * @param string $dto
103
     * @param int $oncreated
104
     * @return mixed
105
     */
106
    public function fetch_bookings_codes($dfrom, $dto, $oncreated = 1)
107
    {
108
        return $this->call_method($this->token, 'fetch_bookings_codes', [$dfrom, $dto, $oncreated]);
109
    }
110
111
    /**
112
     * http://tdocs.wubook.net/wired/fetch.html#fetch_booking
113
     *
114
     * @param string $rcode
115
     * @param boolean $ancillary
116
     * @return mixed
117
     */
118
    public function fetch_booking($rcode, $ancillary = false)
119
    {
120
        return $this->call_method($this->token, 'fetch_booking', [$rcode, $ancillary]);
121
    }
122
123
    /**
124
     * http://tdocs.wubook.net/wired/fetch.html#get_fount_symbols
125
     *
126
     * @return mixed
127
     */
128
    public function get_fount_symbols()
129
    {
130
        return $this->call_method($this->token, 'get_fount_symbols', [], ['token' => $this->get_token($this->token)]);
0 ignored issues
show
Unused Code introduced by
The call to WuBookReservations::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...
131
    }
132
133
    /**
134
     * http://tdocs.wubook.net/wired/rsrvs.html#cancel_reservation
135
     *
136
     * @param string $rcode
137
     * @param string $reason
138
     * @return mixed
139
     */
140
    public function cancel_reservation($rcode, $reason = '')
141
    {
142
        return $this->call_method($this->token, 'cancel_reservation', [$rcode, $reason]);
143
    }
144
145
    /**
146
     * http://tdocs.wubook.net/wired/rsrvs.html#new_reservation
147
     *
148
     * @param array $data
149
     * @return mixed
150
     */
151
    public function new_reservation($data)
152
    {
153
        return $this->call_method($this->token, 'new_reservation', $data);
154
    }
155
}
156