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

nette / latte / 16317493748

16 Jul 2025 10:49AM UTC coverage: 93.696% (-0.002%) from 93.698%
16317493748

push

github

dg
PrintContent: refactoring and updated operator precedence and associativity table

23 of 23 new or added lines in 1 file covered. (100.0%)

30 existing lines in 15 files now uncovered.

5187 of 5536 relevant lines covered (93.7%)

0.94 hits per line

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

50.0
/src/Latte/Compiler/Nodes/Php/MatchArmNode.php
1
<?php
2

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

8
declare(strict_types=1);
9

10
namespace Latte\Compiler\Nodes\Php;
11

12
use Latte\Compiler\Node;
13
use Latte\Compiler\Position;
14
use Latte\Compiler\PrintContext;
15
use Latte\Helpers;
16

17

18
class MatchArmNode extends Node
19
{
20
        public function __construct(
1✔
21
                /** @var ExpressionNode[]|null */
22
                public ?array $conds,
23
                public ExpressionNode $body,
24
                public ?Position $position = null,
25
        ) {
26
        }
1✔
27

28

29
        public function print(PrintContext $context): string
1✔
30
        {
31
                return ($this->conds ? $context->implode($this->conds) : 'default')
1✔
32
                        . ' => '
1✔
33
                        . $this->body->print($context);
1✔
34
        }
35

36

UNCOV
37
        public function &getIterator(): \Generator
×
38
        {
39
                if ($this->conds) {
×
40
                        foreach ($this->conds as &$item) {
×
UNCOV
41
                                yield $item;
×
42
                        }
43
                        Helpers::removeNulls($this->conds);
×
44
                }
UNCOV
45
                yield $this->body;
×
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