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

nette / component-model / 11187771706

07 Aug 2024 12:35AM UTC coverage: 86.047%. Remained the same
11187771706

push

github

dg
improved phpDoc

185 of 215 relevant lines covered (86.05%)

0.86 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

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

27

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

36

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

© 2025 Coveralls, Inc