1 | <?php |
||
10 | class Driver implements \Bernard\Driver |
||
11 | { |
||
12 | const QUEUE_PREFIX = 'queue:'; |
||
13 | |||
14 | protected $redis; |
||
15 | |||
16 | /** |
||
17 | * @param Redis $redis |
||
18 | */ |
||
19 | 8 | public function __construct(Redis $redis) |
|
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | */ |
||
27 | 2 | public function listQueues() |
|
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | 2 | public function createQueue($queueName) |
|
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | 2 | public function countMessages($queueName) |
|
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | 2 | public function pushMessage($queueName, $message) |
|
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | 1 | public function popMessage($queueName, $duration = 5) |
|
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | 2 | public function peekQueue($queueName, $index = 0, $limit = 20) |
|
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | public function acknowledgeMessage($queueName, $receipt) |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | 2 | public function removeQueue($queueName) |
|
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | public function info() |
||
107 | |||
108 | /** |
||
109 | * Transform the queueName into a key. |
||
110 | * |
||
111 | * @param string $queueName |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | 8 | protected function resolveKey($queueName) |
|
119 | } |
||
120 |
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: