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

nette / component-model / 21196390649

21 Jan 2026 03:42AM UTC coverage: 87.156% (+0.6%) from 86.512%
21196390649

push

github

dg
added types tests

190 of 218 relevant lines covered (87.16%)

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
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
declare(strict_types=1);
9

10
namespace Nette\ComponentModel;
11

12
use function iterator_count;
13

14

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

30

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

39

40
        /**
41
         * Returns the count of elements.
42
         */
43
        public function count(): int
44
        {
45
                return iterator_count($this);
×
46
        }
47
}
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