| 1 | <?php |
||
| 10 | class SyncPublisher implements QueuePublisher |
||
| 11 | { |
||
| 12 | /** @var Driver */ |
||
| 13 | private $driver; |
||
| 14 | |||
| 15 | /** @var string */ |
||
| 16 | private $exchangeName; |
||
| 17 | |||
| 18 | /** @var int */ |
||
| 19 | private $timeout; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Constructor |
||
| 23 | * |
||
| 24 | * @param Driver $driver |
||
| 25 | * @param string $exchangeName |
||
| 26 | * @param int $timeout |
||
| 27 | */ |
||
| 28 | public function __construct(Driver $driver, $exchangeName, $timeout = 10) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Publish a message on the queue |
||
| 37 | * |
||
| 38 | * @param mixed $data |
||
| 39 | * @param string $routingKey |
||
| 40 | * @param string[] $headers |
||
| 41 | * |
||
| 42 | * @return mixed |
||
| 43 | */ |
||
| 44 | public function publish($data, $routingKey = '', array $headers = []) |
||
| 69 | } |
||
| 70 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: