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

nette / forms / 19653371509

24 Nov 2025 11:59PM UTC coverage: 93.393%. Remained the same
19653371509

push

github

dg
Latte: rewritten Runtime as non-static class

32 of 33 new or added lines in 6 files covered. (96.97%)

2078 of 2225 relevant lines covered (93.39%)

0.93 hits per line

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

0.0
/src/Bridges/FormsLatte/Nodes/FormPrintNode.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 Nette\Bridges\FormsLatte\Nodes;
11

12
use Latte\Compiler\Nodes\Php\ExpressionNode;
13
use Latte\Compiler\Nodes\StatementNode;
14
use Latte\Compiler\PrintContext;
15
use Latte\Compiler\Tag;
16

17

18
/**
19
 * {formPrint [ClassName]}
20
 * {formClassPrint [ClassName]}
21
 */
22
class FormPrintNode extends StatementNode
23
{
24
        public ?ExpressionNode $name;
25
        public string $mode;
26

27

28
        public static function create(Tag $tag): static
29
        {
30
                $node = new static;
×
31
                $node->name = $tag->parser->isEnd()
×
32
                        ? null
×
33
                        : $tag->parser->parseUnquotedStringOrExpression();
×
34
                $node->mode = $tag->name;
×
35
                return $node;
×
36
        }
37

38

39
        public function print(PrintContext $context): string
40
        {
41
                return $context->format(
×
42
                        'Nette\Forms\Blueprint::%raw('
43
                        . ($this->name
×
44
                                ? 'is_object($ʟ_tmp = %node) ? $ʟ_tmp : $this->global->uiControl[$ʟ_tmp]'
×
NEW
45
                                : '$this->global->forms->current()')
×
46
                        . ') %2.line; exit;',
×
47
                        $this->mode === 'formPrint' ? 'latte' : 'dataClass',
×
48
                        $this->name,
×
49
                        $this->position,
×
50
                );
51
        }
52

53

54
        public function &getIterator(): \Generator
×
55
        {
56
                if ($this->name) {
×
57
                        yield $this->name;
×
58
                }
59
        }
60
}
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