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

nette / latte / 15809643126

22 Jun 2025 06:35PM UTC coverage: 93.67% (+0.09%) from 93.583%
15809643126

push

github

dg
added {include?} {import?} {embed?} {sandbox?}

34 of 36 new or added lines in 7 files covered. (94.44%)

164 existing lines in 43 files now uncovered.

5164 of 5513 relevant lines covered (93.67%)

0.94 hits per line

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

93.75
/src/Latte/Compiler/Nodes/Php/Expression/StaticMethodCallableNode.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\IdentifierNode;
14
use Latte\Compiler\Nodes\Php\NameNode;
15
use Latte\Compiler\Position;
16
use Latte\Compiler\PrintContext;
17
use const PHP_VERSION_ID;
18

19

20
class StaticMethodCallableNode extends ExpressionNode
21
{
22
        public function __construct(
1✔
23
                public NameNode|ExpressionNode $class,
24
                public IdentifierNode|ExpressionNode $name,
25
                public ?Position $position = null,
26
        ) {
27
        }
1✔
28

29

30
        public function print(PrintContext $context): string
1✔
31
        {
32
                $name = match (true) {
1✔
33
                        $this->name instanceof VariableNode => $this->name->print($context),
1✔
34
                        $this->name instanceof ExpressionNode => '{' . $this->name->print($context) . '}',
1✔
35
                        default => $this->name,
1✔
36
                };
37
                return PHP_VERSION_ID < 80100
1✔
UNCOV
38
                        ? '[' . $this->class->print($context) . ', ' . $context->memberAsString($this->name) . ']'
×
39
                        : $context->dereferenceExpr($this->class) . '::' . $name . '(...)';
1✔
40
        }
41

42

43
        public function &getIterator(): \Generator
1✔
44
        {
45
                yield $this->class;
1✔
46
                yield $this->name;
1✔
47
        }
1✔
48
}
49

50

51
class_alias(StaticMethodCallableNode::class, StaticCallableNode::class);
1✔
52

53
if (false) {
1✔
54
        /** @deprecated use Latte\Compiler\Nodes\Php\Expression\StaticMethodCallableNode */
55
        class StaticCallableNode
56
        {
57
        }
58
}
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