From c1f9b1f7b1b77776192048005dcc66dcf3df2bfb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 27 Dec 2014 15:41:37 +0100 Subject: Update to MediaWiki 1.24.1 --- includes/MappedIterator.php | 114 -------------------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 includes/MappedIterator.php (limited to 'includes/MappedIterator.php') diff --git a/includes/MappedIterator.php b/includes/MappedIterator.php deleted file mode 100644 index 70d20327..00000000 --- a/includes/MappedIterator.php +++ /dev/null @@ -1,114 +0,0 @@ -vCallback = $vCallback; - $this->aCallback = isset( $options['accept'] ) ? $options['accept'] : null; - } - - public function next() { - $this->cache = array(); - parent::next(); - } - - public function rewind() { - $this->rewound = true; - $this->cache = array(); - parent::rewind(); - } - - public function accept() { - $value = call_user_func( $this->vCallback, $this->getInnerIterator()->current() ); - $ok = ( $this->aCallback ) ? call_user_func( $this->aCallback, $value ) : true; - if ( $ok ) { - $this->cache['current'] = $value; - } - return $ok; - } - - public function key() { - $this->init(); - return parent::key(); - } - - public function valid() { - $this->init(); - return parent::valid(); - } - - public function current() { - $this->init(); - if ( parent::valid() ) { - return $this->cache['current']; - } else { - return null; // out of range - } - } - - /** - * Obviate the usual need for rewind() before using a FilterIterator in a manual loop - */ - protected function init() { - if ( !$this->rewound ) { - $this->rewind(); - } - } -} -- cgit v1.2.2