Skip to content

Commit

Permalink
More doc fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
boenrobot committed Dec 25, 2014
1 parent 3901ec1 commit 2a0d4a0
Show file tree
Hide file tree
Showing 11 changed files with 349 additions and 440 deletions.
1 change: 1 addition & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ imports:
- php
inherit: true
before_commands:
- composer self-update
- composer require pear2/net_transmitter:dev-develop
- composer require pear2/cache_shm:dev-develop
- composer require pear2/console_commandline
Expand Down
10 changes: 6 additions & 4 deletions src/PEAR2/Net/RouterOS/Communicator.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,19 @@ class Communicator
const CHARSET_LOCAL = 1;

/**
* @var array An array with the default charset types as keys, and the
* default charsets as values.
* @var array<string,string|null> An array with
* the default charset types as keys, and
* the default charsets as values.
*/
protected static $defaultCharsets = array(
self::CHARSET_REMOTE => null,
self::CHARSET_LOCAL => null
);

/**
* @var array An array with the current charset types as keys, and the
* current charsets as values.
* @var array<string,string|null> An array with
* the current charset types as keys, and
* the current charsets as values.
*/
protected $charsets = array();

Expand Down
8 changes: 4 additions & 4 deletions src/PEAR2/Net/RouterOS/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ abstract class Message implements IteratorAggregate, Countable
{

/**
* @var array An array with message attributes. Each array key is the the
* name of an attribute, and the corresponding array value is the value
* for that attribute.
* @var array<string,string|resource> An array with message attributes.
* Each array key is the the name of an attribute,
* and the corresponding array value is the value for that attribute.
*/
protected $attributes = array();

Expand Down Expand Up @@ -106,7 +106,7 @@ public static function sanitizeAttributeName($name)
*
* @param mixed $value The value to sanitize.
*
* @return string The sanitized value.
* @return string|resource The sanitized value.
*/
public static function sanitizeAttributeValue($value)
{
Expand Down
7 changes: 4 additions & 3 deletions src/PEAR2/Net/RouterOS/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ class Query
const OP_GT = '>';

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

Expand Down
5 changes: 3 additions & 2 deletions src/PEAR2/Net/RouterOS/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ public function __construct($uri)
*
* @param string $tag The tag (as received) to parse.
*
* @return array An array with the first member being the ownership tag, and
* the second one being the original tag.
* @return array<int,string|null> An array with
* the first member being the ownership tag, and
* the second one being the original tag.
*/
public static function parseTag($tag)
{
Expand Down
4 changes: 2 additions & 2 deletions src/PEAR2/Net/RouterOS/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Response extends Message
const TYPE_FATAL = '!fatal';

/**
* @var array An array of unrecognized words in network order.
* @var string[] An array of unrecognized words in network order.
*/
protected $unrecognizedWords = array();

Expand Down Expand Up @@ -307,7 +307,7 @@ public function getProperty($name)
/**
* Gets a list of unrecognized words.
*
* @return array The list of unrecognized words.
* @return string[] The list of unrecognized words.
*/
public function getUnrecognizedWords()
{
Expand Down
75 changes: 40 additions & 35 deletions src/PEAR2/Net/RouterOS/ResponseCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,24 @@ class ResponseCollection implements ArrayAccess, SeekableIterator, Countable
{

/**
* @var array An array with all {@link Response} objects.
* @var Response[] An array with all {@link Response} objects.
*/
protected $responses = array();

/**
* @var array An array with each {@link Response} object's type.
* @var string[] An array with each {@link Response} object's type.
*/
protected $responseTypes = array();

/**
* @var array An array with each {@link Response} object's tag.
* @var string[] An array with each {@link Response} object's tag.
*/
protected $responseTags = array();

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

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

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

/**
* Creates a new collection.
*
* @param array $responses An array of responses, in network order.
* @param Response[] $responses An array of responses, in network order.
*/
public function __construct(array $responses)
{
Expand Down Expand Up @@ -198,7 +200,7 @@ public function getIndex()
* @param bool $useIndex Whether to use the index values as keys for the
* resulting array.
*
* @return array An array with all responses, in network order.
* @return Response[] An array with all responses, in network order.
*/
public function toArray($useIndex = false)
{
Expand Down Expand Up @@ -305,9 +307,9 @@ public function offsetUnset($offset)

/**
* Resets the pointer to 0, and returns the first response.
*
* @return Response The first response in the collection, or FALSE if the
* collection is empty.
*
* @return Response|false The first response in the collection,
* or FALSE if the collection is empty.
*/
public function rewind()
{
Expand All @@ -320,9 +322,9 @@ public function rewind()
* @param int|string $position The position to move to. If the collection is
* indexed, you can also supply a value to move the pointer to.
* A non-existent index will move the pointer to "-1".
*
* @return Response The {@link Response} at the specified position, or FALSE
* if the specified position is not valid.
*
* @return Response|false The {@link Response} at the specified position,
* or FALSE if the specified position is not valid.
*/
public function seek($position)
{
Expand All @@ -338,9 +340,9 @@ public function seek($position)

/**
* Moves the pointer forward by 1, and gets the next response.
*
* @return Response The next {@link Response} object, or FALSE if the
* position is not valid.
*
* @return Response|false The next {@link Response} object,
* or FALSE if the position is not valid.
*/
public function next()
{
Expand All @@ -350,9 +352,9 @@ public function next()

/**
* Gets the response at the current pointer position.
*
* @return Response The response at the current pointer position, or FALSE
* if the position is not valid.
*
* @return Response|false The response at the current pointer position,
* or FALSE if the position is not valid.
*/
public function current()
{
Expand All @@ -361,9 +363,9 @@ public function current()

/**
* Moves the pointer backwards by 1, and gets the previous response.
*
* @return Response The next {@link Response} object, or FALSE if the
* position is not valid.
*
* @return Response|false The next {@link Response} object,
* or FALSE if the position is not valid.
*/
public function prev()
{
Expand All @@ -374,9 +376,9 @@ public function prev()
/**
* Moves the pointer to the last valid position, and returns the last
* response.
*
* @return Response The last response in the collection, or FALSE if the
* collection is empty.
*
* @return Response|false The last response in the collection,
* or FALSE if the collection is empty.
*/
public function end()
{
Expand All @@ -386,9 +388,10 @@ public function end()

/**
* Gets the key at the current pointer position.
*
* @return int The key at the current pointer position, i.e. the pointer
* position itself, or FALSE if the position is not valid.
*
* @return int|false The key at the current pointer position,
* i.e. the pointer position itself, or FALSE if the position
* is not valid.
*/
public function key()
{
Expand All @@ -410,8 +413,9 @@ public function valid()
*
* Gets all distinct property names across all responses.
*
* @return array An array with all distinct property names as keys, and the
* indexes at which they occur as values.
* @return array<string,int[]> An array with
* all distinct property names as keys, and
* the indexes at which they occur as values.
*/
public function getPropertyMap()
{
Expand Down Expand Up @@ -469,7 +473,8 @@ public function getAllTagged($tag)
/**
* Order resones by criteria.
*
* @param mixed[] $criteria The criteria to order responses by. It takes the
* @param string[]|array<string,null|int|array<int|callable>> $criteria The
* criteria to order responses by. It takes the
* form of an array where each key is the name of the property to use
* as (N+1)th sorting key. The value of each member can be either NULL
* (for that property, sort normally in ascending order), a single sort
Expand Down
3 changes: 3 additions & 0 deletions tests/Client/Unsafe/Persistent/UnencryptedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

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

use Exception;
use PEAR2\Net\RouterOS\Client;
use PEAR2\Net\RouterOS\Request;
use PEAR2\Net\RouterOS\Response;
use PEAR2\Net\RouterOS\Test\Client\Unsafe\Persistent;

require_once __DIR__ . '/../Persistent.php';
Expand Down
Loading

0 comments on commit 2a0d4a0

Please sign in to comment.