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

nette / forms / 19788540141

29 Nov 2025 07:50PM UTC coverage: 92.968% (-0.06%) from 93.023%
19788540141

Pull #347

github

web-flow
Merge aa0ec7ff1 into 0e1918f18
Pull Request #347: Allow to delegate rule validation to (Validated)Control

12 of 14 new or added lines in 2 files covered. (85.71%)

55 existing lines in 9 files now uncovered.

2089 of 2247 relevant lines covered (92.97%)

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
                if ($tag->name === 'formPrint') {
×
31
                        trigger_error('Tag {formPrint} is deprecated, use Nette\Forms\Blueprint::latte($form)', E_USER_DEPRECATED);
×
32
                } else {
33
                        trigger_error('Tag {formClassPrint} is deprecated, use Nette\Forms\Blueprint::dataClass($form)', E_USER_DEPRECATED);
×
34
                }
35
                $node = new static;
×
36
                $node->name = $tag->parser->isEnd()
×
UNCOV
37
                        ? null
×
38
                        : $tag->parser->parseUnquotedStringOrExpression();
×
UNCOV
39
                $node->mode = $tag->name;
×
40
                return $node;
×
41
        }
42

43

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

58

59
        public function &getIterator(): \Generator
×
60
        {
UNCOV
61
                if ($this->name) {
×
UNCOV
62
                        yield $this->name;
×
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