for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace unreal4u\MQTT\Protocol;
use unreal4u\MQTT\Internals\ProtocolBase;
use unreal4u\MQTT\Internals\ReadableContent;
use unreal4u\MQTT\Internals\ReadableContentInterface;
use unreal4u\MQTT\Internals\WritableContent;
use unreal4u\MQTT\Internals\WritableContentInterface;
final class PubRec extends ProtocolBase implements ReadableContentInterface, WritableContentInterface
{
use ReadableContent;
use WritableContent;
public $packetIdentifier = 0;
const CONTROL_PACKET_VALUE = 5;
public function fillObject(string $rawMQTTHeaders): ReadableContentInterface
$this->packetIdentifier = $this->extractPacketIdentifier($rawMQTTHeaders);
return $this;
}
/**
* Creates the variable header that each method has
* @return string
*/
public function createVariableHeader(): string
// TODO: Implement createVariableHeader() method.
return '';
* Creates the actual payload to be sent
public function createPayload(): string
// TODO: Implement createPayload() method.
* What specific kind of post we should expect back from this request
*
* @param string $data
* @return ReadableContentInterface
public function expectAnswer(string $data): ReadableContentInterface
* Some responses won't expect an answer back, others do in some situations
* @return bool
public function shouldExpectAnswer(): bool
return false;