• 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

86.67
/src/Tempest/Framework/Commands/MigrateFreshCommand.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Framework\Commands;
6

7
use Tempest\Console\Console;
8
use Tempest\Console\ConsoleCommand;
9
use Tempest\Console\ExitCode;
10
use Tempest\Console\Middleware\CautionMiddleware;
11
use Tempest\Console\Middleware\ForceMiddleware;
12
use Tempest\Container\Singleton;
13
use Tempest\Database\Migrations\FreshMigrationFailed;
14
use Tempest\Database\Migrations\MigrationManager;
15
use Tempest\Database\Migrations\TableDropped;
16
use Tempest\EventBus\EventHandler;
17

18
#[Singleton]
19
final class MigrateFreshCommand
20
{
21
    private int $count = 0;
22

23
    public function __construct(
58✔
24
        private readonly Console $console,
25
        private readonly MigrationManager $migrationManager,
26
    ) {}
58✔
27

28
    #[ConsoleCommand(
1✔
29
        name: 'migrate:fresh',
30
        description: 'Drops all tables and rerun migrations from scratch',
31
        middleware: [ForceMiddleware::class, CautionMiddleware::class],
32
    )]
33
    public function __invoke(): ExitCode
34
    {
35
        $this->console->info('Dropping tables…');
1✔
36

37
        $this->migrationManager->dropAll();
1✔
38

39
        $this->console
1✔
40
            ->success(sprintf('Dropped %s tables', $this->count))
1✔
41
            ->writeln();
1✔
42

43
        $this->console->info('Migrate up…');
1✔
44

45
        return $this->console->call('migrate:up');
1✔
46
    }
47

48
    #[EventHandler]
58✔
49
    public function onTableDropped(TableDropped $event): void
50
    {
51
        $this->console->writeln("- Dropped {$event->name}");
58✔
52
        $this->count += 1;
58✔
53
    }
54

UNCOV
55
    #[EventHandler]
×
56
    public function onFreshMigrationFailed(FreshMigrationFailed $event): void
57
    {
UNCOV
58
        $this->console->error($event->throwable->getMessage());
×
59
    }
60
}
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