• 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

85.71
/src/Tempest/View/src/IsView.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\View;
6

7
use function Tempest\Support\path;
8

9
/** @phpstan-require-implements \Tempest\View\View */
10
trait IsView
11
{
12
    public string $path;
13

14
    public ?string $relativeRootPath = null;
15

16
    public array $data = [];
17

18
    public function __construct(
111✔
19
        string $path,
20
        array $data = [],
21
    ) {
22
        $this->path = $path;
111✔
23
        $this->data = $data;
111✔
24

25
        $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
111✔
26

27
        if (str_ends_with($trace[0]['file'], 'Tempest/View/src/functions.php')) {
111✔
28
            $this->relativeRootPath = path($trace[1]['file'])->dirname();
46✔
29
        } else {
30
            $this->relativeRootPath = path($trace[0]['file'])->dirname();
68✔
31
        }
32
    }
33

34
    public function get(string $key): mixed
14✔
35
    {
36
        return $this->{$key} ?? $this->data[$key] ?? null;
14✔
37
    }
38

39
    public function has(string $key): bool
×
40
    {
UNCOV
41
        return array_key_exists($key, $this->data) || property_exists($this, $key);
×
42
    }
43

44
    public function data(mixed ...$params): self
114✔
45
    {
46
        $this->data = [...$this->data, ...$params];
114✔
47

48
        return $this;
114✔
49
    }
50
}
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