diff --git a/composer.json b/composer.json index 5aad82909..a4e611cda 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ }, "scripts": { "test": [ - "parallel-lint . --exclude vendor --exclude includes/iterator/CallbackFilterIterator.php", + "parallel-lint . --exclude vendor", "phpcs" ] } diff --git a/includes/iterator/CallbackFilterIterator.php b/includes/iterator/CallbackFilterIterator.php index 4095d1d43..e4aa4a221 100644 --- a/includes/iterator/CallbackFilterIterator.php +++ b/includes/iterator/CallbackFilterIterator.php @@ -1,24 +1,27 @@ callback = $callback; - } + public function __construct( Iterator $iterator, $callback ) { + parent::__construct( $iterator ); + $this->callback = $callback; + } - public function accept() { - return call_user_func( - $this->callback, - $this->current(), - $this->key(), - $this->getInnerIterator() - ); + public function accept() { + return call_user_func( + $this->callback, + $this->current(), + $this->key(), + $this->getInnerIterator() + ); + } } }