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

nette / latte / 22359082277

24 Feb 2026 04:03PM UTC coverage: 93.959% (+0.05%) from 93.907%
22359082277

push

github

dg
fixed operator ! priority

5273 of 5612 relevant lines covered (93.96%)

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 declare(strict_types=1);
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
namespace Latte\Compiler\Nodes\Php\Expression;
9

10
use Latte\Compiler\Nodes\Php;
11
use Latte\Compiler\Nodes\Php\ExpressionNode;
12
use Latte\Compiler\Nodes\Php\IdentifierNode;
13
use Latte\Compiler\Nodes\Php\NameNode;
14
use Latte\Compiler\Position;
15
use Latte\Compiler\PrintContext;
16
use Latte\Helpers;
17

18

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

31

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

45

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

57

58
class_alias(StaticMethodCallNode::class, StaticCallNode::class);
1✔
59

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