Conditions | 9 |
Paths | 6 |
Total Lines | 31 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | protected function initKeywordsData() |
||
39 | { |
||
40 | if (!empty($this->decodedRaw)) { |
||
41 | return; |
||
42 | } |
||
43 | |||
44 | $contents = $this->response->getBody()->getContents(); |
||
45 | if (empty($contents)) { |
||
46 | return; |
||
47 | } |
||
48 | |||
49 | $this->decodedRaw = \GuzzleHttp\json_decode($contents); |
||
50 | if ($this->decodedRaw->results) { |
||
51 | foreach ($this->decodedRaw->results as $k=>$res) { |
||
52 | if ($k == '_empty_') { |
||
53 | $this->keywords[] = ['kw'=>$res[0]->string, |
||
54 | 'vol'=>intval($res[0]->volume)]; |
||
55 | continue; |
||
56 | } |
||
57 | |||
58 | foreach ($res as $keyword) { |
||
59 | $volume = 0; |
||
60 | if (!empty($keyword->volume)) { |
||
61 | $volume = intval($keyword->volume) > 0 ? intval($keyword->volume) : 0; |
||
62 | } |
||
63 | $this->keywords[] = ['kw'=>$keyword->string, |
||
64 | 'vol'=>$volume]; |
||
65 | } |
||
66 | } |
||
67 | } |
||
68 | } |
||
69 | |||
79 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..