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

nette / latte / 20080863484

09 Dec 2025 10:41PM UTC coverage: 94.909% (+0.003%) from 94.906%
20080863484

push

github

dg
refactor: decentralize operator precedence to individual nodes

Move operator precedence definitions from centralized PrintContext lookup
table to individual operator nodes via OperatorNode interface

42 of 43 new or added lines in 14 files covered. (97.67%)

4 existing lines in 4 files now uncovered.

5537 of 5834 relevant lines covered (94.91%)

0.95 hits per line

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

71.43
/src/Latte/Compiler/Nodes/Php/Expression/NotNode.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\ExpressionNode;
13
use Latte\Compiler\Nodes\Php\OperatorNode;
14
use Latte\Compiler\Position;
15
use Latte\Compiler\PrintContext;
16

17

18
class NotNode extends ExpressionNode implements OperatorNode
19
{
20
        public function __construct(
1✔
21
                public ExpressionNode $expr,
22
                public ?Position $position = null,
23
        ) {
24
        }
1✔
25

26

27
        public function print(PrintContext $context): string
1✔
28
        {
29
                return $context->prefixOp($this, '!', $this->expr);
1✔
30
        }
31

32

33
        public function getOperatorPrecedence(): array
34
        {
35
                return [240, self::AssociativityRight];
1✔
36
        }
37

38

UNCOV
39
        public function &getIterator(): \Generator
×
40
        {
41
                yield $this->expr;
×
42
        }
43
}
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