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

tempestphp / tempest-framework / 14631166702

23 Apr 2025 11:43AM UTC coverage: 80.194% (-1.0%) from 81.234%
14631166702

push

github

web-flow
fix(support): fix psr-4 namespace path generation with dots and slashes in the composer path (#1166)

1 of 1 new or added line in 1 file covered. (100.0%)

12 existing lines in 4 files now uncovered.

11758 of 14662 relevant lines covered (80.19%)

105.26 hits per line

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

89.47
/src/Tempest/Database/src/Builder/QueryBuilders/DeleteQueryBuilder.php
1
<?php
2

3
namespace Tempest\Database\Builder\QueryBuilders;
4

5
use Tempest\Database\Builder\ModelDefinition;
6
use Tempest\Database\Builder\TableDefinition;
7
use Tempest\Database\Query;
8
use Tempest\Database\QueryStatements\DeleteStatement;
9
use Tempest\Database\QueryStatements\WhereStatement;
10
use Tempest\Support\Conditions\HasConditions;
11

12
use function Tempest\Database\model;
13

14
/**
15
 * @template TModelClass of object
16
 */
17
final class DeleteQueryBuilder
18
{
19
    use HasConditions;
20

21
    private DeleteStatement $delete;
22

23
    private array $bindings = [];
24

25
    public function __construct(
6✔
26
        private string|object $model,
27
    ) {
28
        $table = ModelDefinition::tryFrom($this->model)?->getTableDefinition() ?? new TableDefinition($this->model);
6✔
29
        $this->delete = new DeleteStatement($table);
6✔
30

31
        if (model($this->model)->isObjectModel() && is_object($this->model)) {
6✔
32
            $this->where('`id` = :id', id: $this->model->id);
3✔
33
        }
34
    }
35

UNCOV
36
    public function execute(): void
×
37
    {
UNCOV
38
        $this->build()->execute();
×
39
    }
40

41
    public function allowAll(): self
1✔
42
    {
43
        $this->delete->allowAll = true;
1✔
44

45
        return $this;
1✔
46
    }
47

48
    public function where(string $where, mixed ...$bindings): self
5✔
49
    {
50
        $this->delete->where[] = new WhereStatement($where);
5✔
51

52
        $this->bind(...$bindings);
5✔
53

54
        return $this;
5✔
55
    }
56

57
    public function bind(mixed ...$bindings): self
5✔
58
    {
59
        $this->bindings = [...$this->bindings, ...$bindings];
5✔
60

61
        return $this;
5✔
62
    }
63

64
    public function build(): Query
6✔
65
    {
66
        return new Query($this->delete, $this->bindings);
6✔
67
    }
68
}
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