1 | <?php |
||
14 | class IronDriver extends AbstractPersistanceDriver |
||
15 | { |
||
16 | /** |
||
17 | * @var IronMQ |
||
18 | */ |
||
19 | private $iron; |
||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | private $options; |
||
24 | |||
25 | /** |
||
26 | * @param IronMQ $iron |
||
27 | * @param Serializer $serializer |
||
28 | * @param array $options Properties to pass with the message |
||
29 | */ |
||
30 | 8 | public function __construct(IronMQ $iron, Serializer $serializer = null, array $options = []) |
|
36 | |||
37 | /** |
||
38 | * @inheritDoc |
||
39 | */ |
||
40 | 1 | public function enqueue($queueName, Message $message) |
|
50 | |||
51 | /** |
||
52 | * @inheritDoc |
||
53 | */ |
||
54 | 2 | public function dequeue($queueName) |
|
67 | |||
68 | /** |
||
69 | * @inheritDoc |
||
70 | */ |
||
71 | 3 | public function ack($queueName, Envelope $envelope) |
|
72 | { |
||
73 | 3 | if (!$envelope instanceof IronEnvelope) { |
|
74 | 1 | throw new InvalidEnvelope(sprintf( |
|
75 | 1 | '%s requires that envelopes be instances of "%s", got "%s"', |
|
76 | 1 | __CLASS__, |
|
77 | 1 | IronEnvelope::class, |
|
78 | get_class($envelope) |
||
79 | )); |
||
80 | } |
||
81 | |||
82 | 2 | $this->iron->deleteMessage($queueName, $envelope->getId(), $envelope->getReservationId()); |
|
83 | 2 | } |
|
84 | |||
85 | /** |
||
86 | * @inheritDoc |
||
87 | */ |
||
88 | 1 | public function retry($queueName, Envelope $envelope) |
|
92 | |||
93 | /** |
||
94 | * @inheritDoc |
||
95 | */ |
||
96 | 1 | public function fail($queueName, Envelope $envelope) |
|
100 | } |
||
101 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):