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

tempestphp / tempest-framework / 14024978163

23 Mar 2025 05:55PM UTC coverage: 79.391% (-0.05%) from 79.441%
14024978163

push

github

web-flow
feat(view): cache Blade and Twig templates in internal storage (#1061)

2 of 2 new or added lines in 2 files covered. (100.0%)

912 existing lines in 110 files now uncovered.

10478 of 13198 relevant lines covered (79.39%)

91.09 hits per line

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

88.89
/src/Tempest/View/src/Elements/RawElement.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\View\Elements;
6

7
use Tempest\View\Element;
8

9
use function Tempest\Support\str;
10

11
final class RawElement implements Element
12
{
13
    use IsElement;
14

15
    public function __construct(
5✔
16
        private readonly ?string $tag,
17
        private readonly string $content,
18
        array $attributes = [],
19
    ) {
20
        $this->attributes = $attributes;
5✔
21
    }
22

23
    public function compile(): string
5✔
24
    {
25
        if ($this->tag === null) {
5✔
26
            return $this->content;
3✔
27
        }
28

29
        $attributes = [];
2✔
30

31
        foreach ($this->getAttributes() as $name => $value) {
2✔
32
            $name = str($name);
1✔
33

34
            if ($name->startsWith(':')) {
1✔
UNCOV
35
                $name = ':' . $name->kebab()->toString();
×
36
            } else {
37
                $name = $name->kebab()->toString();
1✔
38
            }
39

40
            if ($value) {
1✔
41
                $attributes[] = $name . '="' . $value . '"';
1✔
42
            } else {
UNCOV
43
                $attributes[] = $name;
×
44
            }
45
        }
46

47
        $attributes = implode(' ', $attributes);
2✔
48

49
        if ($attributes !== '') {
2✔
50
            $attributes = ' ' . $attributes;
1✔
51
        }
52

53
        return "<{$this->tag}{$attributes}>{$this->content}</{$this->tag}>";
2✔
54
    }
55
}
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