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

nette / forms / 26452888331

26 May 2026 02:01PM UTC coverage: 93.307% (+0.07%) from 93.241%
26452888331

push

github

dg
added CLAUDE.md

2105 of 2256 relevant lines covered (93.31%)

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 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 Nette\Bridges\FormsLatte\Nodes;
9

10
use Latte\Compiler\Nodes\Php\ExpressionNode;
11
use Latte\Compiler\Nodes\StatementNode;
12
use Latte\Compiler\PrintContext;
13
use Latte\Compiler\Tag;
14

15

16
/**
17
 * {formPrint [name]}
18
 * {formClassPrint [name]}
19
 * Generates Latte template or data class blueprint for form.
20
 */
21
class FormPrintNode extends StatementNode
22
{
23
        public ?ExpressionNode $name;
24
        public string $mode;
25

26

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

37

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

52

53
        public function &getIterator(): \Generator
×
54
        {
55
                if ($this->name) {
×
56
                        yield $this->name;
×
57
                }
58
        }
59
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc