Browse Source

tune of code with according to PSR standards, readLiterator fix, now Client object will source of new object

pull/14/head
Paul Rock 6 years ago
parent
commit
ca2646b2be
  1. 8
      src/Client.php
  2. 2
      src/Interfaces/ClientInterface.php

8
src/Client.php

@ -179,11 +179,11 @@ class Client implements Interfaces\ClientInterface
/** /**
* Read using Iterators to improve performance on large dataset * Read using Iterators to improve performance on large dataset
* *
* @return Iterators\ResponseIterator
* @return \RouterOS\ResponseIterator
*/ */
public function readAsIterator()
public function readAsIterator(): ResponseIterator
{ {
return new Iterators\ResponseIterator($this->read(false));
return new ResponseIterator($this);
} }
/** /**
@ -236,7 +236,7 @@ class Client implements Interfaces\ClientInterface
* @param array $response Response data * @param array $response Response data
* @return array Array with parsed data * @return array Array with parsed data
*/ */
protected function parseResponse(array $response): array
public function parseResponse(array $response): array
{ {
$result = []; $result = [];
$i = -1; $i = -1;

2
src/Interfaces/ClientInterface.php

@ -58,7 +58,7 @@ interface ClientInterface
* @param bool $parse * @param bool $parse
* @return mixed * @return mixed
*/ */
public function read(bool $parse = true);
public function read(bool $parse);
/** /**
* Send write query to RouterOS (with or without tag) * Send write query to RouterOS (with or without tag)

Loading…
Cancel
Save