Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 57a5991

Browse files
committed
Fix damn cs errors
1 parent c283b98 commit 57a5991

3 files changed

Lines changed: 79 additions & 63 deletions

File tree

src/Connection.php

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function getSubscriptions()
8585
}
8686

8787
/**
88-
* Connection options object
88+
* Connection options object.
8989
*
9090
* @var ConnectionOptions|null
9191
*/
@@ -118,6 +118,7 @@ public function __construct(ConnectionOptions $options = null)
118118
* Sends data thought the stream.
119119
*
120120
* @param string $payload Message data.
121+
*
121122
* @return void
122123
*/
123124
private function send($payload)
@@ -147,6 +148,7 @@ private function receive($len = null)
147148
*
148149
* @param string $address Server url string.
149150
* @param integer $timeout Number of seconds until the connect() system call should timeout.
151+
*
150152
* @return resource
151153
* @throws \Exception Exception raised if connection fails.
152154
*/
@@ -177,6 +179,7 @@ public function isConnected()
177179
* Connect to server.
178180
*
179181
* @param integer $timeout Number of seconds until the connect() system call should timeout.
182+
*
180183
* @throws \Exception Exception raised if connection fails.
181184
* @return void
182185
*/
@@ -202,10 +205,12 @@ public function ping()
202205
/**
203206
* Request does a request and executes a callback with the response.
204207
*
205-
* @param string $subject Message topic.
206-
* @param string $payload Message data.
207-
* @param resource $callback Closure to be executed as callback.
208-
* @param integer $quantity Number of messages to wait for.
208+
* @param string $subject Message topic.
209+
* @param string $payload Message data.
210+
* @param mixed $callback Closure to be executed as callback.
211+
* @param integer $wait Number of messages to wait for.
212+
*
213+
* @return void
209214
*/
210215
public function request($subject, $payload, $callback, $wait = 1)
211216
{
@@ -224,6 +229,7 @@ public function request($subject, $payload, $callback, $wait = 1)
224229
*
225230
* @param string $subject Message topic.
226231
* @param string $payload Message data.
232+
*
227233
* @return void
228234
*/
229235
public function publish($subject, $payload)
@@ -236,8 +242,9 @@ public function publish($subject, $payload)
236242
/**
237243
* Subscribes to an specific event given a subject.
238244
*
239-
* @param string $subject Message topic.
240-
* @param resource $callback Closure to be executed as callback.
245+
* @param string $subject Message topic.
246+
* @param mixed $callback Closure to be executed as callback.
247+
*
241248
* @return string
242249
*/
243250
public function subscribe($subject, $callback)
@@ -254,6 +261,7 @@ public function subscribe($subject, $callback)
254261
* Unsubscribe from a event given a subject.
255262
*
256263
* @param string $sid Subscription ID.
264+
*
257265
* @return void
258266
*/
259267
public function unsubscribe($sid)
@@ -310,6 +318,7 @@ private function handleMSG($line)
310318
* Waits for messages.
311319
*
312320
* @param integer $quantity Number of messages to wait for.
321+
*
313322
* @return resource $connection Connection object
314323
*/
315324
public function wait($quantity = 0)

src/ConnectionOptions.php

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,76 +2,76 @@
22
namespace Nats;
33

44
/**
5-
* ConnectionOptions Class
5+
* ConnectionOptions Class.
66
*/
77
class ConnectionOptions
88
{
99

1010
/**
11-
* Hostname or IP to connect
11+
* Hostname or IP to connect.
1212
*
1313
* @var string
1414
*/
1515
private $host = "localhost";
1616

1717
/**
18-
* Port number to connect
18+
* Port number to connect.
1919
*
2020
* @var integer
2121
*/
2222
private $port = 4222;
2323

2424
/**
25-
* Username to connect
25+
* Username to connect.
2626
*
2727
* @var string
2828
*/
2929
private $user = null;
3030

3131
/**
32-
* Password to connect
32+
* Password to connect.
3333
*
3434
* @var string
3535
*/
3636
private $pass = null;
3737

3838
/**
39-
* Language of this client
39+
* Language of this client.
4040
*
4141
* @var string
4242
*/
4343
private $lang = "php";
4444

4545
/**
46-
* Version of this client
46+
* Version of this client.
4747
*
4848
* @var string
4949
*/
5050
private $version = "0.0.5";
5151

5252
/**
53-
* If verbose mode is enabled
53+
* If verbose mode is enabled.
5454
*
5555
* @var boolean
5656
*/
5757
private $verbose = false;
5858

5959
/**
60-
* If pedantic mode is enabled
60+
* If pedantic mode is enabled.
6161
*
6262
* @var boolean
6363
*/
6464
private $pedantic = false;
6565

6666
/**
67-
* If reconnect mode is enabled
67+
* If reconnect mode is enabled.
6868
*
6969
* @var boolean
7070
*/
7171
private $reconnect = true;
7272

7373
/**
74-
* Get the URI for a server
74+
* Get the URI for a server.
7575
*
7676
* @return string
7777
*/
@@ -81,7 +81,7 @@ public function getAddress()
8181
}
8282

8383
/**
84-
* Get the options JSON string
84+
* Get the options JSON string.
8585
*
8686
* @return string
8787
*/
@@ -103,7 +103,7 @@ public function __toString()
103103
}
104104

105105
/**
106-
* Get host
106+
* Get host.
107107
*
108108
* @return string
109109
*/
@@ -113,7 +113,7 @@ public function getHost()
113113
}
114114

115115
/**
116-
* Set host
116+
* Set host.
117117
*
118118
* @param string $host Host.
119119
*
@@ -127,7 +127,7 @@ public function setHost($host)
127127
}
128128

129129
/**
130-
* Get port
130+
* Get port.
131131
*
132132
* @return integer
133133
*/
@@ -137,7 +137,7 @@ public function getPort()
137137
}
138138

139139
/**
140-
* Set port
140+
* Set port.
141141
*
142142
* @param integer $port Port.
143143
*
@@ -151,7 +151,7 @@ public function setPort($port)
151151
}
152152

153153
/**
154-
* Get user
154+
* Get user.
155155
*
156156
* @return string
157157
*/
@@ -161,7 +161,7 @@ public function getUser()
161161
}
162162

163163
/**
164-
* Set user
164+
* Set user.
165165
*
166166
* @param string $user User.
167167
*
@@ -175,7 +175,7 @@ public function setUser($user)
175175
}
176176

177177
/**
178-
* Get password
178+
* Get password.
179179
*
180180
* @return string
181181
*/
@@ -185,7 +185,7 @@ public function getPass()
185185
}
186186

187187
/**
188-
* Set password
188+
* Set password.
189189
*
190190
* @param string $pass Password.
191191
*
@@ -199,7 +199,7 @@ public function setPass($pass)
199199
}
200200

201201
/**
202-
* Get language
202+
* Get language.
203203
*
204204
* @return string
205205
*/
@@ -209,7 +209,7 @@ public function getLang()
209209
}
210210

211211
/**
212-
* Set language
212+
* Set language.
213213
*
214214
* @param string $lang Language.
215215
*
@@ -223,7 +223,7 @@ public function setLang($lang)
223223
}
224224

225225
/**
226-
* Get version
226+
* Get version.
227227
*
228228
* @return string
229229
*/
@@ -233,7 +233,7 @@ public function getVersion()
233233
}
234234

235235
/**
236-
* Set version
236+
* Set version.
237237
*
238238
* @param string $version Version number.
239239
*
@@ -247,7 +247,7 @@ public function setVersion($version)
247247
}
248248

249249
/**
250-
* Get verbose
250+
* Get verbose.
251251
*
252252
* @return boolean
253253
*/
@@ -257,7 +257,7 @@ public function isVerbose()
257257
}
258258

259259
/**
260-
* Set verbose
260+
* Set verbose.
261261
*
262262
* @param boolean $verbose Verbose flag.
263263
*
@@ -271,7 +271,7 @@ public function setVerbose($verbose)
271271
}
272272

273273
/**
274-
* Get pedantic
274+
* Get pedantic.
275275
*
276276
* @return boolean
277277
*/
@@ -281,7 +281,7 @@ public function isPedantic()
281281
}
282282

283283
/**
284-
* Set pedantic
284+
* Set pedantic.
285285
*
286286
* @param boolean $pedantic Pedantic flag.
287287
*
@@ -295,7 +295,7 @@ public function setPedantic($pedantic)
295295
}
296296

297297
/**
298-
* Get reconnect
298+
* Get reconnect.
299299
*
300300
* @return boolean
301301
*/
@@ -305,7 +305,7 @@ public function isReconnect()
305305
}
306306

307307
/**
308-
* Set reconnect
308+
* Set reconnect.
309309
*
310310
* @param boolean $reconnect Reconnect flag.
311311
*

0 commit comments

Comments
 (0)