@@ -74,14 +74,15 @@ class Client
74
74
protected $ pendingRequestsCount = 0 ;
75
75
76
76
/**
77
- * @var array An array of responses that have not yet been extracted or
78
- * passed to a callback. Key is the tag of the request, and the value
79
- * is an array of associated responses.
77
+ * @var array<string,Response> An array of responses that have not yet been
78
+ * extracted or passed to a callback. Key is the tag of the request,
79
+ * and the value is an array of associated responses.
80
80
*/
81
81
protected $ responseBuffer = array ();
82
82
83
83
/**
84
- * @var array An array of callbacks to be executed as responses come.
84
+ * @var array<string,callback> An array of callbacks to be executed
85
+ * as responses come.
85
86
* Key is the tag of the request, and the value is the callback for it.
86
87
*/
87
88
protected $ callbacks = array ();
@@ -438,8 +439,8 @@ public function sendSync(Request $request)
438
439
* Starts an event loop for the RouterOS callbacks and finishes when a
439
440
* specified request is completed.
440
441
*
441
- * @param string $tag The tag of the request to complete. Setting NULL
442
- * completes all requests.
442
+ * @param string|null $tag The tag of the request to complete.
443
+ * Setting NULL completes all requests.
443
444
*
444
445
* @return ResponseCollection A collection of {@link Response} objects that
445
446
* haven't been passed to a callback function or previously extracted
@@ -482,7 +483,8 @@ public function completeRequest($tag = null)
482
483
* Gets all new responses for a request that haven't been passed to a
483
484
* callback and clears the buffer from them.
484
485
*
485
- * @param string $tag The tag of the request to extract new responses for.
486
+ * @param string|null $tag The tag of the request to extract
487
+ * new responses for.
486
488
* Specifying NULL with extract new responses for all requests.
487
489
*
488
490
* @return ResponseCollection A collection of {@link Response} objects for
@@ -527,9 +529,9 @@ public function extractNewResponses($tag = null)
527
529
* are no more pending requests or when a specified timeout has passed
528
530
* (whichever comes first).
529
531
*
530
- * @param int $sTimeout Timeout for the loop. If NULL, there is no time
531
- * limit.
532
- * @param int $usTimeout Microseconds to add to the time limit.
532
+ * @param int|null $sTimeout Timeout for the loop.
533
+ * If NULL, there is no time limit.
534
+ * @param int $usTimeout Microseconds to add to the time limit.
533
535
*
534
536
* @return bool TRUE when there are any more pending requests, FALSE
535
537
* otherwise.
@@ -598,8 +600,8 @@ public function getPendingRequestsCount()
598
600
* removes any responses for it that were not previously extracted with
599
601
* {@link static::extractNewResponses()}.
600
602
*
601
- * @param string $tag Tag of the request to cancel. Setting NULL will cancel
602
- * all requests.
603
+ * @param string|null $tag Tag of the request to cancel.
604
+ * Setting NULL will cancel all requests.
603
605
*
604
606
* @return $this The client object.
605
607
* @see sendAsync()
@@ -775,9 +777,10 @@ protected function send(Request $request)
775
777
* Dispatches the next response in queue, i.e. it executes the associated
776
778
* callback if there is one, or places the response in the response buffer.
777
779
*
778
- * @param int $sTimeout If a response is not immediately available, wait
779
- * this many seconds. If NULL, wait indefinitely.
780
- * @param int $usTimeout Microseconds to add to the waiting time.
780
+ * @param int|null $sTimeout If a response is not immediately available,
781
+ * wait this many seconds.
782
+ * If NULL, wait indefinitely.
783
+ * @param int $usTimeout Microseconds to add to the waiting time.
781
784
*
782
785
* @throws SocketException When there's no response within the time limit.
783
786
* @return Response The dispatched response.
0 commit comments