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

nette / latte / 8714886967

17 Apr 2024 01:27AM UTC coverage: 93.539% (-0.6%) from 94.097%
8714886967

push

github

dg
Blueprint::printClass() rewritten (BC break)

17 of 29 new or added lines in 3 files covered. (58.62%)

23 existing lines in 1 file now uncovered.

5009 of 5355 relevant lines covered (93.54%)

0.94 hits per line

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

0.0
/src/Latte/Essential/Nodes/VarPrintNode.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\Essential\Nodes;
11

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

16

17
/**
18
 * {varPrint [all]}
19
 */
20
class VarPrintNode extends StatementNode
21
{
22
        public bool $all;
23

24

25
        public static function create(Tag $tag): static
26
        {
27
                $stream = $tag->parser->stream;
×
28
                $node = new static;
×
29
                $node->all = $stream->consume()->text === 'all';
×
30
                return $node;
×
31
        }
32

33

34
        public function print(PrintContext $context): string
35
        {
NEW
36
                $vars = $this->all
×
NEW
37
                        ? 'get_defined_vars()'
×
38
                        : 'array_diff_key(get_defined_vars(), $this->getParameters())';
×
39
                return <<<XX
NEW
40
                        \$ʟ_bp = new Latte\\Essential\\Blueprint;
×
41
                        \$ʟ_bp->printBegin();
NEW
42
                        \$ʟ_bp->printVars($vars);
×
43
                        \$ʟ_bp->printEnd();
44
                        exit;
45
                        XX;
46
        }
47

48

49
        public function &getIterator(): \Generator
×
50
        {
51
                false && yield;
52
        }
53
}
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