oliverlorenz/phpMqttClient

View on GitHub
src/packet/Unsubscribe.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
/**
 * @author Oliver Lorenz
 * @since 2015-05-08
 * Time: 17:10
 */

namespace oliverlorenz\reactphpmqtt\packet;

/**
 * An UNSUBSCRIBE Packet is sent by the Client to the Server, to
 * unsubscribe from topics.
 */
class Unsubscribe extends ControlPacket {

    public static function getControlPacketType()
    {
        return ControlPacketType::UNSUBSCRIBE;
    }

    /**
     * @param string $topic
     */
    public function removeSubscription($topic)
    {
        $this->payload .= $this->getLengthPrefixField($topic);
    }
}