for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace unreal4u\MQTT\Application;
use unreal4u\MQTT\Internals\ProtocolBase;
use unreal4u\MQTT\Internals\WritableContent;
use unreal4u\MQTT\Internals\WritableContentInterface;
/**
* This is an example of a payload class that performs some processing on the data
*
* This particular case will prepend a datetime to the message itself. It will json_encode() it into the payload and
* when retrieving it will set the public property $originalPublishDateTime.
*/
final class EmptyWritableResponse extends ProtocolBase implements WritableContentInterface
{
use /** @noinspection TraitsPropertiesConflictsInspection */
WritableContent;
private const CONTROL_PACKET_VALUE = 0;
* Creates the variable header that each method has
* @return string
public function createVariableHeader(): string
return '';
}
* Creates the actual payload to be sent
public function createPayload(): string
* Some responses won't expect an answer back, others do in some situations
* @return bool
public function shouldExpectAnswer(): bool
return false;