• 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

95.24
/src/Latte/Compiler/Nodes/Php/Expression/StaticMethodCallNode.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\ExpressionNode;
14
use Latte\Compiler\Nodes\Php\IdentifierNode;
15
use Latte\Compiler\Nodes\Php\NameNode;
16
use Latte\Compiler\Position;
17
use Latte\Compiler\PrintContext;
18
use Latte\Helpers;
19

20

21
class StaticMethodCallNode extends ExpressionNode
22
{
23
        public function __construct(
1✔
24
                public NameNode|ExpressionNode $class,
25
                public IdentifierNode|ExpressionNode $name,
26
                /** @var array<Php\ArgumentNode> */
27
                public array $args = [],
28
                public ?Position $position = null,
29
        ) {
30
                (function (Php\ArgumentNode ...$args) {})(...$args);
1✔
31
        }
1✔
32

33

34
        public function print(PrintContext $context): string
1✔
35
        {
36
                $name = match (true) {
1✔
37
                        $this->name instanceof VariableNode => $this->name->print($context),
1✔
38
                        $this->name instanceof ExpressionNode => '{' . $this->name->print($context) . '}',
1✔
39
                        default => $this->name,
1✔
40
                };
41
                return $context->dereferenceExpr($this->class)
1✔
42
                        . '::'
1✔
43
                        . $name
1✔
44
                        . '(' . $context->implode($this->args) . ')';
1✔
45
        }
46

47

48
        public function &getIterator(): \Generator
1✔
49
        {
50
                yield $this->class;
1✔
51
                yield $this->name;
1✔
52
                foreach ($this->args as &$item) {
1✔
UNCOV
53
                        yield $item;
×
54
                }
55
                Helpers::removeNulls($this->args);
1✔
56
        }
1✔
57
}
58

59

60
class_alias(StaticMethodCallNode::class, StaticCallNode::class);
1✔
61

62
if (false) {
1✔
63
        /** @deprecated use Latte\Compiler\Nodes\Php\Expression\StaticMethodCallNode */
64
        class StaticCallNode
65
        {
66
        }
67
}
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