Total Complexity | 6 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class OpenOrdersRequest implements RequestInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var bool |
||
17 | */ |
||
18 | private $trades; |
||
19 | /** |
||
20 | * @var string|null |
||
21 | */ |
||
22 | private $userref; |
||
23 | |||
24 | /** |
||
25 | * OrderBookRequest constructor. |
||
26 | * |
||
27 | * @param bool $trades |
||
28 | * @param null $userref |
||
29 | */ |
||
30 | public function __construct($trades = false, $userref = null) |
||
31 | { |
||
32 | $this->trades = $trades; |
||
33 | $this->userref = $userref; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Returns the api request name |
||
38 | * |
||
39 | * @return string |
||
40 | */ |
||
41 | public function getMethod() |
||
42 | { |
||
43 | return 'OpenOrders'; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @return string |
||
48 | */ |
||
49 | public function getVisibility() |
||
50 | { |
||
51 | return VisibilityEnum::VISIBILITY_PRIVATE; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @return array |
||
56 | */ |
||
57 | public function getRequestData() |
||
58 | { |
||
59 | $arr = []; |
||
60 | $arr["trades"] = $this->trades; |
||
61 | if ($this->userref) { |
||
|
|||
62 | $arr["userref"] = $this->userref; |
||
63 | } |
||
64 | |||
65 | return $arr; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getResponseClassName() |
||
74 | } |
||
75 | } |
||
76 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: