From 7398caa099da59fd0ef43ed3b8316e1b5decaca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hu=CC=88rtgen?= Date: Thu, 27 Apr 2017 10:23:02 +0200 Subject: [PATCH] =?UTF-8?q?TASK:=20Simplfy=20=E2=80=9Cfeatures"=20iterator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Standards/Typo3Update/Feature/Features.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Standards/Typo3Update/Feature/Features.php b/src/Standards/Typo3Update/Feature/Features.php index 4db9e97..befea8f 100644 --- a/src/Standards/Typo3Update/Feature/Features.php +++ b/src/Standards/Typo3Update/Feature/Features.php @@ -28,12 +28,6 @@ use Typo3Update\Options; */ class Features implements \Iterator { - /** - * Internal array position for \Iterator implementation. - * @var int - */ - protected $index = 0; - /** * Internal array * @var array @@ -73,22 +67,22 @@ class Features implements \Iterator // implement Iterator interface: public function current() { - return $this->features[$this->index]; + return current($this->features); } public function key() { - return $this->index; + return key($this->features); } public function next() { - ++$this->index; + next($this->features); } public function rewind() { - $this->index = 0; + reset($this->features); } public function valid() { - return isset($this->features[$this->index]); + return current($this->features) !== false; } }