WuBookTransactions::balance_details()   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 WuBookTransactions
18
 *
19
 * @author Filippo Galante <[email protected]>
20
 */
21
class WuBookTransactions 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/transactions.html#balance_transactions
41
     *
42
     * @return mixed
43
     */
44
    public function balance_transactions()
45
    {
46
        return $this->call_method($this->token, 'balance_transactions', [], ['token' => $this->get_token($token)]);
0 ignored issues
show
Bug introduced by
The variable $token does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
Unused Code introduced by
The call to WuBookTransactions::call_method() has too many arguments starting with array('token' => $this->get_token($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...
47
    }
48
49
    /**
50
     * http://tdocs.wubook.net/wired/transactions.html#balance_details
51
     *
52
     * @param int $id
53
     * @return mixed
54
     */
55
    public function balance_details($id)
56
    {
57
        return $this->call_method($this->token, 'balance_details', [$id]);
58
    }
59
}
60