diff --git a/docs/exception.rst b/docs/exception.rst new file mode 100644 index 0000000..d4fceb3 --- /dev/null +++ b/docs/exception.rst @@ -0,0 +1,6 @@ +==================== +Mosquitto\\Exception +==================== + +This is an exception that may be thrown by many of the operations in the Client object. It does not add any features to the standard PHP `Exception` class. + diff --git a/docs/index.rst b/docs/index.rst index 16a819b..c439a30 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,6 +15,8 @@ Contents overview client + message + exception diff --git a/docs/message.rst b/docs/message.rst new file mode 100644 index 0000000..ab30499 --- /dev/null +++ b/docs/message.rst @@ -0,0 +1,44 @@ +================== +Mosquitto\\Message +================== + +.. php:namespace:: Mosquitto + +.. php:class:: Message + + Represents a message received from a broker. All data is represented as properties. + + .. php:attr:: $topic + + (*string*) The topic this message was delivered to. + + .. php:attr:: $payload + + (*string*) The payload of this message. + + .. php:attr:: $mid + + (*int*) The ID of this message. + + .. php:attr:: $qos + + (*int*) The QoS value applied to this message. + + .. php:attr:: $retain + + (*boolean*) Whether this is a retained message or not. + + This class has two static methods. + + .. php:staticmethod:: topicMatchesSub() + + Returns true if the supplied topic matches the supplied description, and otherwise false. + + :param string $topic: The topic to match + :param string $subscription: The subscription to match + + .. php:staticmethod:: tokeniseTopic() + + Tokenise a topic or subscription string into an array of strings representing the topic hierarchy. + + :param string $topic: The topic to tokenise