Skip to content

Commit

Permalink
Add Message and Exception documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdm committed Sep 5, 2016
1 parent c5bcca5 commit 5ef12f2
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/exception.rst
Original file line number Diff line number Diff line change
@@ -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.

2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Contents

overview
client
message
exception



Expand Down
44 changes: 44 additions & 0 deletions docs/message.rst
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5ef12f2

Please sign in to comment.