Conditions | 5 |
Paths | 12 |
Total Lines | 25 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | protected function _get($path, $data = []) |
||
38 | { |
||
39 | if($this->_responseLocale) |
||
|
|||
40 | { |
||
41 | $data['locale'] = $this->_responseLocale; |
||
42 | } |
||
43 | |||
44 | if($this->_jsonP) |
||
45 | { |
||
46 | $data['jsonp'] = $this->_jsonP; |
||
47 | } |
||
48 | |||
49 | $data['apikey'] = $this->_apiKey; |
||
50 | |||
51 | try |
||
52 | { |
||
53 | return Curl::get($this->_makeApiUrl($path), $data)->run()->getJson(); |
||
54 | } |
||
55 | catch(CurlException $e) |
||
56 | { |
||
57 | $json = $e->getResponse()->getJson(); |
||
58 | $message = isset($json['reason']) ? $json['reason'] : $e->getMessage(); |
||
59 | throw new BattleNetException($message); |
||
60 | } |
||
61 | } |
||
62 | } |
||
63 |
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: