for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Burrow\Publisher;
use Burrow\Driver;
use Burrow\Message;
use Burrow\QueuePublisher;
class AsyncPublisher implements QueuePublisher
{
/** @var Driver */
private $driver;
/** @var string */
private $exchangeName;
/**
* Constructor
*
* @param Driver $driver
* @param string $exchangeName
*/
public function __construct(Driver $driver, $exchangeName)
$this->driver = $driver;
$this->exchangeName = $exchangeName;
}
* Publish a message on the queue
* @param mixed $data
* @param string $routingKey
* @param string[] $headers
* @return mixed
public function publish($data, $routingKey = '', array $headers = [])
$this->driver->publish($this->exchangeName, new Message($data, $routingKey, $headers));
$headers
array<integer,string>
array<integer,object<string>>
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:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
return null;
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: