Skip to content

Commit 56ed4a1

Browse files
committed
Removed PseudoServer.php and associated tests -
The conditions that this utility tested are now tested in PEAR2_Net_Transmitter; Doc and organization fixes.
1 parent d322ece commit 56ed4a1

File tree

11 files changed

+30
-320
lines changed

11 files changed

+30
-320
lines changed

package.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@
153153
<file role="test" name="ClientPersistentFeaturesTest.php"/>
154154
<file role="test" name="ConnectionTest.php"/>
155155
<file role="test" name="phpunit.xml"/>
156-
<file role="test" name="PseudoServer.php"/>
157156
<file role="test" name="RequestHandlingTest.php"/>
158157
<file role="test" name="StateAlteringFeaturesTest.php"/>
159158
</dir>
@@ -218,7 +217,6 @@
218217
<install name="tests/ClientPersistentFeaturesTest.php" as="ClientPersistentFeaturesTest.php"/>
219218
<install name="tests/ConnectionTest.php" as="ConnectionTest.php"/>
220219
<install name="tests/phpunit.xml" as="phpunit.xml"/>
221-
<install name="tests/PseudoServer.php" as="PseudoServer.php"/>
222220
<install name="tests/RequestHandlingTest.php" as="RequestHandlingTest.php"/>
223221
<install name="tests/StateAlteringFeaturesTest.php" as="StateAlteringFeaturesTest.php"/>
224222
</filelist>

src/PEAR2/Net/RouterOS/Client.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function __construct($host, $username, $password = '', $port = 8728,
149149
*
150150
* @param mixed $arg Value can be either a {@link Request} to send, which
151151
* would be sent asynchoniously if it has a tag, and synchroniously if not,
152-
* a number to loop with or null to complete all pending requests. Any other
152+
* a number to loop with or NULL to complete all pending requests. Any other
153153
* value is converted to string and treated as the tag of a request to
154154
* complete.
155155
*
@@ -300,7 +300,7 @@ public function getCharset($charsetType)
300300
* the request is canceled. Note that the callback may be executed one last
301301
* time after that with a response that notifies about the canceling.
302302
*
303-
* @return Client The client object.
303+
* @return self|Client The client object.
304304
* @see completeRequest()
305305
* @see loop()
306306
* @see cancelRequest()
@@ -520,7 +520,7 @@ public function getPendingRequestsCount()
520520
* @param string $tag Tag of the request to cancel. Setting NULL will cancel
521521
* all requests.
522522
*
523-
* @return Client The client object.
523+
* @return self|Client The client object.
524524
* @see sendAsync()
525525
* @see close()
526526
*/
@@ -661,7 +661,7 @@ public function __destruct()
661661
*
662662
* @param Request $request The request to send.
663663
*
664-
* @return Client The client object.
664+
* @return self|Client The client object.
665665
* @see sendSync()
666666
* @see sendAsync()
667667
*/

src/PEAR2/Net/RouterOS/Message.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function getTag()
119119
*
120120
* @param string $tag The tag to set.
121121
*
122-
* @return Message The message object.
122+
* @return self|Message The message object.
123123
* @see getTag()
124124
*/
125125
protected function setTag($tag)
@@ -166,7 +166,7 @@ public function getAllArguments()
166166
* @param string $value Value of the argument. Setting the value to NULL
167167
* removes an argument of this name.
168168
*
169-
* @return Message The message object.
169+
* @return self|Message The message object.
170170
* @see getArgument()
171171
*/
172172
protected function setArgument($name, $value = '')
@@ -183,7 +183,7 @@ protected function setArgument($name, $value = '')
183183
/**
184184
* Removes all arguments from the message.
185185
*
186-
* @return Message The message object.
186+
* @return self|Message The message object.
187187
*/
188188
protected function removeAllArguments()
189189
{

src/PEAR2/Net/RouterOS/Query.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected static function sanitizeAction($action)
111111
* @param string $action One of the ACTION_* constants. Describes the
112112
* operation to perform.
113113
*
114-
* @return Query The query object.
114+
* @return self|Query The query object.
115115
*/
116116
public static function where(
117117
$name, $value = null, $action = self::ACTION_EXIST
@@ -123,7 +123,7 @@ public static function where(
123123
/**
124124
* Negates the query.
125125
*
126-
* @return Query The query object.
126+
* @return self|Query The query object.
127127
*/
128128
public function not()
129129
{
@@ -140,7 +140,7 @@ public function not()
140140
* @param string $action One of the ACTION_* constants. Describes the
141141
* operation to perform.
142142
*
143-
* @return Query The query object.
143+
* @return self|Query The query object.
144144
*/
145145
public function orWhere($name, $value = null, $action = self::ACTION_EXIST)
146146
{
@@ -157,7 +157,7 @@ public function orWhere($name, $value = null, $action = self::ACTION_EXIST)
157157
* @param string $action One of the ACTION_* constants. Describes the
158158
* operation to perform.
159159
*
160-
* @return Query The query object.
160+
* @return self|Query The query object.
161161
*/
162162
public function andWhere($name, $value = null, $action = self::ACTION_EXIST)
163163
{
@@ -227,7 +227,7 @@ private function _send(Communicator $com)
227227
* @param string $action One of the ACTION_* constants. Describes the
228228
* operation to perform.
229229
*
230-
* @return Query The query object.
230+
* @return self|Query The query object.
231231
*/
232232
protected function addWhere($name, $value, $action)
233233
{

src/PEAR2/Net/RouterOS/Registry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Registry
6666
*/
6767
public function __construct($uri)
6868
{
69-
$this->shm = new SHM('PEAR2\Net\RouterOS\Registry ' . $uri);
69+
$this->shm = new SHM(__CLASS__ . ' ' . $uri);
7070
if (-1 === self::$requestId) {
7171
self::$requestId = $this->shm->add('requestId', 0)
7272
? 0 : $this->shm->inc('requestId');
@@ -161,7 +161,7 @@ public function getOwnershipTag()
161161
* response.
162162
* @param string $ownershipTag The ownership tag that the response had.
163163
*
164-
* @return boolean TRUE if the request was added to its buffer, FALSE if
164+
* @return bool TRUE if the request was added to its buffer, FALSE if
165165
* this instance owns the response, and therefore doesn't need to add the
166166
* response to its buffer.
167167
*/

src/PEAR2/Net/RouterOS/Request.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ public function __construct($command, Query $query = null, $tag = null)
8383
* the class is invoked and its returned value is returned by this function.
8484
*
8585
* @param mixed $arg A {@link Query} to associate the request
86-
* with, a {@link Communicator} to send the request over, or an argument to
87-
* get the value of. If a second argument is provided, this becomes the name
88-
* of the argument to set the value of.
86+
* with, a {@link Communicator} to send the request over, an argument to
87+
* get the value of, or NULL to get all arguments as an array. If a second
88+
* argument is provided, this becomes the name of the argument to set the
89+
* value of, and the second argument is the value to set.
8990
*
9091
* @return mixed Whatever the long form function would have returned.
9192
*/
@@ -112,7 +113,7 @@ public function __invoke($arg = null)
112113
*
113114
* @param string $command The command to send.
114115
*
115-
* @return Request The request object.
116+
* @return self|Request The request object.
116117
* @see getCommand()
117118
* @see setArgument()
118119
*/
@@ -172,7 +173,7 @@ public function getCommand()
172173
* @param Query $query The query to be set. Setting NULL will remove the
173174
* currently associated query.
174175
*
175-
* @return Request The request object.
176+
* @return self|Request The request object.
176177
* @see getQuery()
177178
*/
178179
public function setQuery(Query $query = null)
@@ -200,7 +201,7 @@ public function getQuery()
200201
*
201202
* @param string $tag The tag to set.
202203
*
203-
* @return Request The request object.
204+
* @return self|Request The request object.
204205
* @see getTag()
205206
*/
206207
public function setTag($tag)
@@ -215,7 +216,7 @@ public function setTag($tag)
215216
* @param string $value Value of the argument. Setting the value to NULL
216217
* removes an argument of this name.
217218
*
218-
* @return Request The request object.
219+
* @return self|Request The request object.
219220
* @see getArgument()
220221
*/
221222
public function setArgument($name, $value = '')
@@ -226,7 +227,7 @@ public function setArgument($name, $value = '')
226227
/**
227228
* Removes all arguments from the request.
228229
*
229-
* @return Request The request object.
230+
* @return self|Request The request object.
230231
*/
231232
public function removeAllArguments()
232233
{
@@ -319,7 +320,7 @@ protected function parseArgumentString($string)
319320
* <argument> := <name>, <value>?
320321
* <name> := <<[^\=\s]+>>
321322
* <value> := "=", (<quoted string> | <unquoted string>)
322-
* <quotedString> := <<">>, <<([^"]|\\")*>>, <<">>
323+
* <quotedString> := <<">>, <<([^"]|\\"|\\\\)*>>, <<">>
323324
* <unquotedString> := <<\S+>>
324325
*/
325326

src/PEAR2/Net/RouterOS/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private function _receive(Communicator $com, $asStream = false)
194194
*
195195
* @param string $type The new response type.
196196
*
197-
* @return Response The response object.
197+
* @return self|Response The response object.
198198
* @see getType()
199199
*/
200200
protected function setType($type)

0 commit comments

Comments
 (0)