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

tempestphp / tempest-framework / 14049246919

24 Mar 2025 09:42PM UTC coverage: 79.353% (-0.04%) from 79.391%
14049246919

push

github

web-flow
feat(support): support array parameters in string manipulations (#1073)

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

735 existing lines in 126 files now uncovered.

10492 of 13222 relevant lines covered (79.35%)

90.78 hits per line

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

69.23
/src/Tempest/Database/src/QueryStatements/DropTableStatement.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Database\QueryStatements;
6

7
use Tempest\Database\Config\DatabaseDialect;
8
use Tempest\Database\QueryStatement;
9

10
final class DropTableStatement implements QueryStatement
11
{
12
    use CanExecuteStatement;
13

14
    public function __construct(
59✔
15
        private readonly string $tableName,
16
        /** @var \Tempest\Database\QueryStatements\DropConstraintStatement[] $dropReferences */
17
        private array $dropReferences = [],
18
    ) {}
59✔
19

UNCOV
20
    public function dropReference(string $foreign): self
×
21
    {
UNCOV
22
        $this->dropReferences[] = new DropConstraintStatement($this->tableName, $foreign);
×
23

UNCOV
24
        return $this;
×
25
    }
26

27
    /** @param class-string<\Tempest\Database\DatabaseModel> $modelClass */
28
    public static function forModel(string $modelClass): self
1✔
29
    {
30
        return new self($modelClass::table()->tableName);
1✔
31
    }
32

33
    public function compile(DatabaseDialect $dialect): string
59✔
34
    {
35
        $statements = [];
59✔
36

37
        foreach ($this->dropReferences as $dropReference) {
59✔
UNCOV
38
            $statements[] = $dropReference->compile($dialect);
×
39
        }
40

41
        $statements[] = sprintf('DROP TABLE IF EXISTS `%s`', $this->tableName);
59✔
42

43
        return implode('; ', $statements) . ';';
59✔
44
    }
45
}
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