• 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.0
/src/Tempest/Database/src/Query.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Database;
6

7
use function Tempest\get;
8

9
final class Query
10
{
11
    public function __construct(
657✔
12
        public string $sql,
13
        public array $bindings = [],
14
    ) {
15
    }
657✔
16

17
    public function execute(mixed ...$bindings): Id
657✔
18
    {
19
        $this->bindings = [...$this->bindings, ...$bindings];
657✔
20

21
        $database = $this->getDatabase();
657✔
22

23
        $query = $this->withBindings($bindings);
657✔
24

25
        $database->execute($query);
657✔
26

27
        return isset($query->bindings['id'])
657✔
28
            ? new Id($query->bindings['id'])
15✔
29
            : $database->getLastInsertId();
657✔
30
    }
31

32
    public function fetch(mixed ...$bindings): array
657✔
33
    {
34
        return $this->getDatabase()->fetch($this->withBindings($bindings));
657✔
35
    }
36

37
    public function fetchFirst(mixed ...$bindings): ?array
1✔
38
    {
39
        return $this->getDatabase()->fetchFirst($this->withBindings($bindings));
1✔
40
    }
41

42
    public function getSql(): string
657✔
43
    {
44
        return $this->sql;
657✔
45
    }
46

47
    public function append(string $append): self
×
48
    {
UNCOV
49
        $this->sql .= PHP_EOL . $append;
×
50

UNCOV
51
        return $this;
×
52
    }
53

54
    public function withBindings(array $bindings): self
657✔
55
    {
56
        $clone = clone $this;
657✔
57

58
        $clone->bindings = [...$clone->bindings, ...$bindings];
657✔
59

60
        return $clone;
657✔
61
    }
62

63
    private function getDatabase(): Database
657✔
64
    {
65
        return get(Database::class);
657✔
66
    }
67
}
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