Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ReadTheDocs for documentation #50

Merged
merged 12 commits into from
Sep 6, 2016
Prev Previous commit
Next Next commit
Add Message and Exception documentation
  • Loading branch information
mgdm committed Sep 5, 2016
commit 5ef12f23a0fca8f5e6ec210242a780ad04ed42d1
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