diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..f1cb65b Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/Client.php b/src/Client.php index 2125fce..b0e2e8e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -177,6 +177,7 @@ class Client implements Interfaces\ClientInterface } +<<<<<<< HEAD /** * Read using Iterators to improve performance on large dataset * @@ -185,6 +186,11 @@ class Client implements Interfaces\ClientInterface public function readAsIterator() { return new Iterators\ResponseIterator($this->read(false)); +======= + public function readAsIterators() + { + return new Iterators\ResponseIterator($this->rosario($this->read(false))); +>>>>>>> ccd0d5054aa39ec1c1fa9fdfa26988f4f0d53053 } /** diff --git a/src/Iterators/ResponseIterator.php b/src/Iterators/ResponseIterator.php index 3fba772..0041f28 100644 --- a/src/Iterators/ResponseIterator.php +++ b/src/Iterators/ResponseIterator.php @@ -9,20 +9,29 @@ namespace RouterOS\Iterators; +<<<<<<< HEAD /** * Class ResponseIterator * @package RouterOS\Iterators */ +======= +>>>>>>> ccd0d5054aa39ec1c1fa9fdfa26988f4f0d53053 class ResponseIterator implements \Iterator, \ArrayAccess, \Countable { public $parsed = []; public $raw = []; public $current; +<<<<<<< HEAD public $length; +======= +>>>>>>> ccd0d5054aa39ec1c1fa9fdfa26988f4f0d53053 public function __construct($raw) { $this->current = 0; // This RAW should't be an error $positions = array_keys($raw, '!re'); +<<<<<<< HEAD $this->length = count($positions); +======= +>>>>>>> ccd0d5054aa39ec1c1fa9fdfa26988f4f0d53053 $count = count($raw); $result = []; @@ -35,7 +44,14 @@ class ResponseIterator implements \Iterator, \ArrayAccess, \Countable { : $count - $position; // Convert array to simple items +<<<<<<< HEAD $item = array_slice($raw,$position,$length); +======= + $item = []; + for ($i = 1; $i < $length; $i++) { + $item[] = array_shift($raw); + } +>>>>>>> ccd0d5054aa39ec1c1fa9fdfa26988f4f0d53053 // Save as result $result[] = $item;