Skip to content

Commit 2a0d4a0

Browse files
committed
More doc fixes.
1 parent 3901ec1 commit 2a0d4a0

File tree

11 files changed

+349
-440
lines changed

11 files changed

+349
-440
lines changed

.scrutinizer.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ imports:
22
- php
33
inherit: true
44
before_commands:
5+
- composer self-update
56
- composer require pear2/net_transmitter:dev-develop
67
- composer require pear2/cache_shm:dev-develop
78
- composer require pear2/console_commandline

src/PEAR2/Net/RouterOS/Communicator.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,19 @@ class Communicator
6767
const CHARSET_LOCAL = 1;
6868

6969
/**
70-
* @var array An array with the default charset types as keys, and the
71-
* default charsets as values.
70+
* @var array<string,string|null> An array with
71+
* the default charset types as keys, and
72+
* the default charsets as values.
7273
*/
7374
protected static $defaultCharsets = array(
7475
self::CHARSET_REMOTE => null,
7576
self::CHARSET_LOCAL => null
7677
);
7778

7879
/**
79-
* @var array An array with the current charset types as keys, and the
80-
* current charsets as values.
80+
* @var array<string,string|null> An array with
81+
* the current charset types as keys, and
82+
* the current charsets as values.
8183
*/
8284
protected $charsets = array();
8385

src/PEAR2/Net/RouterOS/Message.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ abstract class Message implements IteratorAggregate, Countable
4848
{
4949

5050
/**
51-
* @var array An array with message attributes. Each array key is the the
52-
* name of an attribute, and the corresponding array value is the value
53-
* for that attribute.
51+
* @var array<string,string|resource> An array with message attributes.
52+
* Each array key is the the name of an attribute,
53+
* and the corresponding array value is the value for that attribute.
5454
*/
5555
protected $attributes = array();
5656

@@ -106,7 +106,7 @@ public static function sanitizeAttributeName($name)
106106
*
107107
* @param mixed $value The value to sanitize.
108108
*
109-
* @return string The sanitized value.
109+
* @return string|resource The sanitized value.
110110
*/
111111
public static function sanitizeAttributeValue($value)
112112
{

src/PEAR2/Net/RouterOS/Query.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ class Query
6363
const OP_GT = '>';
6464

6565
/**
66-
* @var array An array of the words forming the query. Each value is an
67-
* array with the first member being the predicate (operator and name),
68-
* and the second member being the value for the predicate.
66+
* @var array<string,string|null>[] An array of the words forming the query.
67+
* Each value is an array with the first member being the predicate
68+
* (operator and name), and the second member being the value
69+
* for the predicate.
6970
*/
7071
protected $words = array();
7172

src/PEAR2/Net/RouterOS/Registry.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ public function __construct($uri)
8484
*
8585
* @param string $tag The tag (as received) to parse.
8686
*
87-
* @return array An array with the first member being the ownership tag, and
88-
* the second one being the original tag.
87+
* @return array<int,string|null> An array with
88+
* the first member being the ownership tag, and
89+
* the second one being the original tag.
8990
*/
9091
public static function parseTag($tag)
9192
{

src/PEAR2/Net/RouterOS/Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Response extends Message
6464
const TYPE_FATAL = '!fatal';
6565

6666
/**
67-
* @var array An array of unrecognized words in network order.
67+
* @var string[] An array of unrecognized words in network order.
6868
*/
6969
protected $unrecognizedWords = array();
7070

@@ -307,7 +307,7 @@ public function getProperty($name)
307307
/**
308308
* Gets a list of unrecognized words.
309309
*
310-
* @return array The list of unrecognized words.
310+
* @return string[] The list of unrecognized words.
311311
*/
312312
public function getUnrecognizedWords()
313313
{

src/PEAR2/Net/RouterOS/ResponseCollection.php

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,24 @@ class ResponseCollection implements ArrayAccess, SeekableIterator, Countable
6161
{
6262

6363
/**
64-
* @var array An array with all {@link Response} objects.
64+
* @var Response[] An array with all {@link Response} objects.
6565
*/
6666
protected $responses = array();
6767

6868
/**
69-
* @var array An array with each {@link Response} object's type.
69+
* @var string[] An array with each {@link Response} object's type.
7070
*/
7171
protected $responseTypes = array();
7272

7373
/**
74-
* @var array An array with each {@link Response} object's tag.
74+
* @var string[] An array with each {@link Response} object's tag.
7575
*/
7676
protected $responseTags = array();
7777

7878
/**
79-
* @var array An array with positions of responses, based on an property
80-
* name. The name of each property is the array key, and the array value
79+
* @var array<string,array<string,int>> An array with
80+
* positions of responses, based on an property name.
81+
* The name of each property is the array key, and the array value
8182
* is another array where the key is the value for that property, and
8283
* the value is the position of the response. For performance reasons,
8384
* each key is built only when {@link static::setIndex()} is called with
@@ -87,7 +88,7 @@ class ResponseCollection implements ArrayAccess, SeekableIterator, Countable
8788
protected $responsesIndex = array();
8889

8990
/**
90-
* @var array An array with all distinct properties across all
91+
* @var array<string,int[]> An array with all distinct properties across all
9192
* {@link Response} objects. Created at the first call of
9293
* {@link static::getPropertyMap()}.
9394
*/
@@ -104,16 +105,17 @@ class ResponseCollection implements ArrayAccess, SeekableIterator, Countable
104105
protected $index = null;
105106

106107
/**
107-
* @var array Criteria used by {@link compare()} to determine the order
108-
* between two responses. See {@link orderBy()} for a detailed
109-
* description of this array's format.
108+
* @var string[]|array<string,null|int|array<int|callable>> Criteria
109+
* used by {@link static::compare()} to determine
110+
* the order between two responses. See {@link static::orderBy()}
111+
* for a detailed description of this array's format.
110112
*/
111113
protected $compareBy = array();
112114

113115
/**
114116
* Creates a new collection.
115117
*
116-
* @param array $responses An array of responses, in network order.
118+
* @param Response[] $responses An array of responses, in network order.
117119
*/
118120
public function __construct(array $responses)
119121
{
@@ -198,7 +200,7 @@ public function getIndex()
198200
* @param bool $useIndex Whether to use the index values as keys for the
199201
* resulting array.
200202
*
201-
* @return array An array with all responses, in network order.
203+
* @return Response[] An array with all responses, in network order.
202204
*/
203205
public function toArray($useIndex = false)
204206
{
@@ -305,9 +307,9 @@ public function offsetUnset($offset)
305307

306308
/**
307309
* Resets the pointer to 0, and returns the first response.
308-
*
309-
* @return Response The first response in the collection, or FALSE if the
310-
* collection is empty.
310+
*
311+
* @return Response|false The first response in the collection,
312+
* or FALSE if the collection is empty.
311313
*/
312314
public function rewind()
313315
{
@@ -320,9 +322,9 @@ public function rewind()
320322
* @param int|string $position The position to move to. If the collection is
321323
* indexed, you can also supply a value to move the pointer to.
322324
* A non-existent index will move the pointer to "-1".
323-
*
324-
* @return Response The {@link Response} at the specified position, or FALSE
325-
* if the specified position is not valid.
325+
*
326+
* @return Response|false The {@link Response} at the specified position,
327+
* or FALSE if the specified position is not valid.
326328
*/
327329
public function seek($position)
328330
{
@@ -338,9 +340,9 @@ public function seek($position)
338340

339341
/**
340342
* Moves the pointer forward by 1, and gets the next response.
341-
*
342-
* @return Response The next {@link Response} object, or FALSE if the
343-
* position is not valid.
343+
*
344+
* @return Response|false The next {@link Response} object,
345+
* or FALSE if the position is not valid.
344346
*/
345347
public function next()
346348
{
@@ -350,9 +352,9 @@ public function next()
350352

351353
/**
352354
* Gets the response at the current pointer position.
353-
*
354-
* @return Response The response at the current pointer position, or FALSE
355-
* if the position is not valid.
355+
*
356+
* @return Response|false The response at the current pointer position,
357+
* or FALSE if the position is not valid.
356358
*/
357359
public function current()
358360
{
@@ -361,9 +363,9 @@ public function current()
361363

362364
/**
363365
* Moves the pointer backwards by 1, and gets the previous response.
364-
*
365-
* @return Response The next {@link Response} object, or FALSE if the
366-
* position is not valid.
366+
*
367+
* @return Response|false The next {@link Response} object,
368+
* or FALSE if the position is not valid.
367369
*/
368370
public function prev()
369371
{
@@ -374,9 +376,9 @@ public function prev()
374376
/**
375377
* Moves the pointer to the last valid position, and returns the last
376378
* response.
377-
*
378-
* @return Response The last response in the collection, or FALSE if the
379-
* collection is empty.
379+
*
380+
* @return Response|false The last response in the collection,
381+
* or FALSE if the collection is empty.
380382
*/
381383
public function end()
382384
{
@@ -386,9 +388,10 @@ public function end()
386388

387389
/**
388390
* Gets the key at the current pointer position.
389-
*
390-
* @return int The key at the current pointer position, i.e. the pointer
391-
* position itself, or FALSE if the position is not valid.
391+
*
392+
* @return int|false The key at the current pointer position,
393+
* i.e. the pointer position itself, or FALSE if the position
394+
* is not valid.
392395
*/
393396
public function key()
394397
{
@@ -410,8 +413,9 @@ public function valid()
410413
*
411414
* Gets all distinct property names across all responses.
412415
*
413-
* @return array An array with all distinct property names as keys, and the
414-
* indexes at which they occur as values.
416+
* @return array<string,int[]> An array with
417+
* all distinct property names as keys, and
418+
* the indexes at which they occur as values.
415419
*/
416420
public function getPropertyMap()
417421
{
@@ -469,7 +473,8 @@ public function getAllTagged($tag)
469473
/**
470474
* Order resones by criteria.
471475
*
472-
* @param mixed[] $criteria The criteria to order responses by. It takes the
476+
* @param string[]|array<string,null|int|array<int|callable>> $criteria The
477+
* criteria to order responses by. It takes the
473478
* form of an array where each key is the name of the property to use
474479
* as (N+1)th sorting key. The value of each member can be either NULL
475480
* (for that property, sort normally in ascending order), a single sort

tests/Client/Unsafe/Persistent/UnencryptedTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
namespace PEAR2\Net\RouterOS\Test\Client\Unsafe\Persistent;
44

5+
use Exception;
56
use PEAR2\Net\RouterOS\Client;
7+
use PEAR2\Net\RouterOS\Request;
8+
use PEAR2\Net\RouterOS\Response;
69
use PEAR2\Net\RouterOS\Test\Client\Unsafe\Persistent;
710

811
require_once __DIR__ . '/../Persistent.php';

0 commit comments

Comments
 (0)