chapter = $chapter; } /** * Accept sections that are part of the given chapter * * @return bool Whether the current element of the iterator is acceptable * through this filter */ public function accept(): bool { $section = $this->current(); /** @var \Icinga\Module\Doc\DocSection $section */ if ($section->getChapter()->getId() === $this->chapter) { return true; } return false; } public function getChildren(): self { return new static($this->getInnerIterator()->getChildren(), $this->chapter); } public function count(): int { return iterator_count($this); } /** * Whether the filter swallowed every section * * @return bool */ public function isEmpty() { return $this->count() === 0; } }