1 | <?php |
||
46 | class Presence implements ProtocolImplementationInterface |
||
47 | { |
||
48 | /** |
||
49 | * Signals that the entity is available for communication. |
||
50 | */ |
||
51 | |||
52 | const TYPE_AVAILABLE = 'available'; |
||
53 | |||
54 | /** |
||
55 | * Signals that the entity is no longer available for communication. |
||
56 | */ |
||
57 | const TYPE_UNAVAILABLE = 'unavailable'; |
||
58 | |||
59 | /** |
||
60 | * The sender wishes to subscribe to the recipient's presence. |
||
61 | */ |
||
62 | const TYPE_SUBSCRIBE = 'subscribe'; |
||
63 | |||
64 | /** |
||
65 | * The sender has allowed the recipient to receive their presence. |
||
66 | */ |
||
67 | const TYPE_SUBSCRIBED = 'subscribed'; |
||
68 | |||
69 | /** |
||
70 | * The sender is unsubscribing from another entity's presence. |
||
71 | */ |
||
72 | const TYPE_UNSUBSCRIBE = 'unsubscribe'; |
||
73 | |||
74 | /** |
||
75 | * The subscription request has been denied or a previously-granted subscription has been cancelled. |
||
76 | */ |
||
77 | const TYPE_UNSUBSCRIBED = 'unsubscribed'; |
||
78 | |||
79 | /** |
||
80 | * A request for an entity's current presence; SHOULD be generated only by a server on behalf of a user. |
||
81 | */ |
||
82 | const TYPE_PROBE = 'probe'; |
||
83 | |||
84 | /** |
||
85 | * An error has occurred regarding processing or delivery of a previously-sent presence stanza. |
||
86 | */ |
||
87 | const TYPE_ERROR = 'error'; |
||
88 | |||
89 | /** |
||
90 | * The entity or resource is available. |
||
91 | */ |
||
92 | const SHOW_AVAILABLE = 'available'; |
||
93 | |||
94 | /** |
||
95 | * The entity or resource is temporarily away. |
||
96 | */ |
||
97 | const SHOW_AWAY = 'away'; |
||
98 | |||
99 | /** |
||
100 | * The entity or resource is actively interested in chatting. |
||
101 | */ |
||
102 | const SHOW_CHAT = 'chat'; |
||
103 | |||
104 | /** |
||
105 | * The entity or resource is busy (dnd = "Do Not Disturb"). |
||
106 | */ |
||
107 | const SHOW_DND = 'dnd'; |
||
108 | |||
109 | /** |
||
110 | * The entity or resource is away for an extended period (xa = "eXtended Away"). |
||
111 | */ |
||
112 | const SHOW_XA = 'xa'; |
||
113 | |||
114 | /** |
||
115 | * Presence to. |
||
116 | * |
||
117 | * @var string|null |
||
118 | */ |
||
119 | protected $to; |
||
120 | |||
121 | /** |
||
122 | * Priority. |
||
123 | * |
||
124 | * @var integer |
||
125 | */ |
||
126 | protected $priority = 1; |
||
127 | |||
128 | /** |
||
129 | * Nickname for presence. |
||
130 | * |
||
131 | * @var string |
||
132 | */ |
||
133 | protected $nickname; |
||
134 | |||
135 | /** |
||
136 | * Channel password. |
||
137 | * |
||
138 | * @var string |
||
139 | */ |
||
140 | protected $password; |
||
141 | |||
142 | 3 | /** |
|
143 | * Constructor. |
||
144 | 3 | * |
|
145 | 3 | * @param integer $priority |
|
146 | * @param string $to |
||
147 | * @param string $nickname |
||
148 | */ |
||
149 | public function __construct($priority = 1, $to = null, $nickname = null) |
||
153 | |||
154 | 3 | /** |
|
155 | 3 | * {@inheritDoc} |
|
156 | 3 | */ |
|
157 | public function toString() |
||
174 | |||
175 | /** |
||
176 | * Get nickname. |
||
177 | 3 | * |
|
178 | * @return string |
||
179 | 3 | */ |
|
180 | 3 | public function getNickname() |
|
184 | |||
185 | /** |
||
186 | * Set nickname. |
||
187 | * |
||
188 | 3 | * @param string $nickname |
|
189 | * @return $this |
||
190 | 3 | */ |
|
191 | public function setNickname($nickname) |
||
196 | |||
197 | /** |
||
198 | * Get to. |
||
199 | 3 | * |
|
200 | * @return string¦null |
||
201 | 3 | */ |
|
202 | 3 | public function getTo() |
|
206 | |||
207 | /** |
||
208 | * Set to. |
||
209 | * |
||
210 | 3 | * @param string|null $to |
|
211 | * @return $this |
||
212 | 3 | */ |
|
213 | public function setTo($to = null) |
||
218 | |||
219 | /** |
||
220 | * Get priority. |
||
221 | 3 | * |
|
222 | * @return integer |
||
223 | 3 | */ |
|
224 | 3 | public function getPriority() |
|
228 | |||
229 | /** |
||
230 | * Set priority. |
||
231 | * |
||
232 | * @param integer $priority |
||
233 | * @return $this |
||
234 | */ |
||
235 | public function setPriority($priority) |
||
240 | |||
241 | /** |
||
242 | * Get channel password. |
||
243 | * |
||
244 | * @return string¦null |
||
245 | */ |
||
246 | public function getPassword() |
||
250 | |||
251 | /** |
||
252 | * Set channel password. |
||
253 | * |
||
254 | * @param string|null $to |
||
|
|||
255 | * @return $this |
||
256 | */ |
||
257 | public function setPassword($password = null) |
||
262 | } |
||
263 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.