for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace BinaryCube\CarrotMQ\Builder;
use Interop\Amqp\Impl\AmqpMessage;
/**
* Class MessageBuilder
*
* @package BinaryCube\CarrotMQ\Builder
*/
class MessageBuilder
{
* @var string
protected $body;
* @var array
protected $properties = [];
protected $headers = [];
* @return static
public static function create()
return new static();
}
* @param string $body
* @return $this
public function body(string $body)
$this->body = $body;
return $this;
* @param array $properties
public function properties(array $properties)
$this->properties = $properties;
* @param array $headers
public function headers(array $headers)
$this->headers = $headers;
* @return AmqpMessage
public function build()
$message = new AmqpMessage();
$message->setBody($this->body);
$message->setProperties($this->properties);
$message->setHeaders($this->headers);
return $message;