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

nette / latte / 16317387179

16 Jul 2025 10:46AM UTC coverage: 93.699% (-0.1%) from 93.84%
16317387179

push

github

dg
added Helpers::stringOrNull() [Closes #401]

6 of 6 new or added lines in 2 files covered. (100.0%)

57 existing lines in 19 files now uncovered.

5160 of 5507 relevant lines covered (93.7%)

0.94 hits per line

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

95.0
/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

19

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

32

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

46

47
        public function &getIterator(): \Generator
1✔
48
        {
49
                yield $this->class;
1✔
50
                yield $this->name;
1✔
51
                foreach ($this->args as &$item) {
1✔
UNCOV
52
                        yield $item;
×
53
                }
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