Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
collectionfilteriterator.php
1<?php
2
8class CollectionFilterIterator extends \FilterIterator
9{
10 protected $callback = null;
11
17 public function __construct(\Iterator $iterator, $callback)
18 {
19 $this->callback = $callback;
20
21 parent::__construct($iterator);
22 }
23
27 #[\ReturnTypeWillChange]
28 public function accept()
29 {
30 return call_user_func($this->callback, parent::current());
31 }
32
36 public function count()
37 {
38 return iterator_count($this);
39 }
40}