• 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

64.29
/src/Latte/Compiler/Nodes/Php/Expression/MatchNode.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\Expression;
11

12
use Latte\Compiler\Nodes\Php;
13
use Latte\Compiler\Nodes\Php\MatchArmNode;
14
use Latte\Compiler\Position;
15
use Latte\Compiler\PrintContext;
16
use Latte\Helpers;
17

18

19
class MatchNode extends Php\ExpressionNode
20
{
21
        public function __construct(
1✔
22
                public Php\ExpressionNode $cond,
23
                /** @var MatchArmNode[] */
24
                public array $arms = [],
25
                public ?Position $position = null,
26
        ) {
27
                (function (MatchArmNode ...$args) {})(...$arms);
1✔
28
        }
1✔
29

30

31
        public function print(PrintContext $context): string
1✔
32
        {
33
                $res = 'match (' . $this->cond->print($context) . ') {';
1✔
34
                foreach ($this->arms as $node) {
1✔
35
                        $res .= "\n" . $node->print($context) . ',';
1✔
36
                }
37

38
                $res .= "\n}";
1✔
39
                return $res;
1✔
40
        }
41

42

UNCOV
43
        public function &getIterator(): \Generator
×
44
        {
45
                yield $this->cond;
×
46
                foreach ($this->arms as &$item) {
×
UNCOV
47
                        yield $item;
×
48
                }
UNCOV
49
                Helpers::removeNulls($this->arms);
×
50
        }
51
}
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