Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function info() |
||
34 | { |
||
35 | // Temporarily change the command use to get info as earlier and newer redis |
||
36 | // versions breaks it into sections. |
||
37 | $commandClass = $this->redis->getProfile()->getCommandClass('info'); |
||
38 | $this->redis->getProfile()->defineCommand('info', 'Predis\Command\ServerInfo'); |
||
39 | |||
40 | $info = $this->redis->info(); |
||
41 | |||
42 | $this->redis->getProfile()->defineCommand('info', $commandClass); |
||
43 | |||
44 | return $info; |
||
45 | } |
||
46 | } |
||
47 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: