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

tempestphp / tempest-framework / 11743263957

08 Nov 2024 01:43PM UTC coverage: 82.172% (-0.3%) from 82.498%
11743263957

Pull #685

github

web-flow
Merge b9f02ce65 into 04000ace5
Pull Request #685: feat(commandbus): async commands

35 of 81 new or added lines in 6 files covered. (43.21%)

7278 of 8857 relevant lines covered (82.17%)

49.44 hits per line

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

21.43
/src/Tempest/CommandBus/src/AsyncCommandRepositories/FileRepository.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\CommandBus\AsyncCommandRepositories;
6

7
use Tempest\CommandBus\AsyncCommandRepository;
8
use function Tempest\Support\arr;
9

10
final readonly class FileRepository implements AsyncCommandRepository
11
{
12
    public function store(string $uuid, object $command): void
1✔
13
    {
14
        $payload = serialize($command);
1✔
15

16
        file_put_contents(__DIR__ . "/../stored-commands/{$uuid}.txt", $payload);
1✔
17
    }
18

NEW
19
    public function find(string $uuid): object
×
20
    {
NEW
21
        $path = __DIR__ . "/../stored-commands/{$uuid}.txt";
×
22

NEW
23
        $payload = file_get_contents($path);
×
24

NEW
25
        return unserialize($payload);
×
26
    }
27

NEW
28
    public function remove(string $uuid): void
×
29
    {
NEW
30
        $path = __DIR__ . "/../stored-commands/{$uuid}.txt";
×
31

NEW
32
        unlink($path);
×
33
    }
34

NEW
35
    public function available(): array
×
36
    {
NEW
37
        return arr(glob(__DIR__ . "/../stored-commands/*.txt"))
×
NEW
38
            ->map(fn (string $path) => pathinfo($path, PATHINFO_FILENAME))
×
NEW
39
            ->toArray();
×
40
    }
41
}
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