From e45f50408ac5a95f7df77eb6a1faf5bbb392df7f Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 16:14:14 +0200 Subject: [PATCH] Icinga\Protocol\File\Reader::fetchPairs(): rename variables $skipLines -> $skip $readLines -> $read refs #7060 --- library/Icinga/Protocol/File/Reader.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/library/Icinga/Protocol/File/Reader.php b/library/Icinga/Protocol/File/Reader.php index a9b0455b7..1ab088c9c 100644 --- a/library/Icinga/Protocol/File/Reader.php +++ b/library/Icinga/Protocol/File/Reader.php @@ -137,26 +137,26 @@ class Reader extends FilterIterator */ public function fetchPairs(Query $query) { - $skipLines = $query->getOffset(); - $readLines = $query->getLimit(); - if ($skipLines === null) { - $skipLines = 0; + $skip = $query->getOffset(); + $read = $query->getLimit(); + if ($skip === null) { + $skip = 0; } $lines = array(); if ($query->sortDesc()) { $count = $this->count($query); - if ($count <= $skipLines) { + if ($count <= $skip) { return $lines; - } else if ($count < ($skipLines + $readLines)) { - $readLines = $count - $skipLines; - $skipLines = 0; + } else if ($count < ($skip + $read)) { + $read = $count - $skip; + $skip = 0; } else { - $skipLines = $count - ($skipLines + $readLines); + $skip = $count - ($skip + $read); } } foreach ($this as $index => $line) { - if ($index >= $skipLines) { - if ($index >= $skipLines + $readLines) { + if ($index >= $skip) { + if ($index >= $skip + $read) { break; } $lines[] = $line;