• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nette / component-model / 22884715739

04 Mar 2026 07:34AM UTC coverage: 87.444% (+0.3%) from 87.156%
22884715739

push

github

dg
made static analysis mandatory

195 of 223 relevant lines covered (87.44%)

0.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/ComponentModel/RecursiveComponentIterator.php
1
<?php declare(strict_types=1);
2

3
/**
4
 * This file is part of the Nette Framework (https://nette.org)
5
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
 */
7

8
namespace Nette\ComponentModel;
9

10
use function iterator_count;
11

12

13
/**
14
 * Recursive component iterator. See Container::getComponents().
15
 * @internal
16
 * @extends \RecursiveArrayIterator<int|string, IComponent>
17
 */
18
final class RecursiveComponentIterator extends \RecursiveArrayIterator implements \Countable
19
{
20
        /**
21
         * Has the current element has children?
22
         */
23
        public function hasChildren(): bool
24
        {
25
                return $this->current() instanceof IContainer;
1✔
26
        }
27

28

29
        /**
30
         * The sub-iterator for the current element.
31
         */
32
        public function getChildren(): self
33
        {
34
                return new self($this->current()->getComponents());
1✔
35
        }
36

37

38
        /**
39
         * Returns the count of elements.
40
         */
41
        public function count(): int
42
        {
43
                return iterator_count($this);
×
44
        }
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc