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

ericfortmeyer / activity-log / 20534403437

27 Dec 2025 04:38AM UTC coverage: 41.478% (-1.0%) from 42.491%
20534403437

push

github

web-flow
feat: add support for purging account data (#82)

A user should be able to delete all their data.

Signed-off-by: Eric Fortmeyer <e.fortmeyer01@gmail.com>

0 of 21 new or added lines in 3 files covered. (0.0%)

1 existing line in 1 file now uncovered.

348 of 839 relevant lines covered (41.48%)

1.28 hits per line

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

0.0
/src/Http/RequestProcessors/DeleteAllData.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace EricFortmeyer\ActivityLog\Http\RequestProcessors;
6

7
use EricFortmeyer\ActivityLog\Services\TemplateBinder;
8
use EricFortmeyer\ActivityLog\Services\TenantService;
9
use EricFortmeyer\ActivityLog\Tenant;
10
use EricFortmeyer\ActivityLog\UserInterface\Contexts\AccountDeleteSuccessContext;
11
use EricFortmeyer\ActivityLog\UserInterface\Contexts\BadRequestContext;
12
use EricFortmeyer\ActivityLog\Utils\Hasher;
13
use Phpolar\Model\Model;
14
use Phpolar\Phpolar\Auth\Authorize;
15

16
final class DeleteAllData extends AbstractTenantBasedRequestProcessor
17
{
18
    public function __construct(
19
        private readonly TenantService $tenantService,
20
        private readonly TemplateBinder $templateEngine,
21
        Hasher $hasher,
22
    ) {
NEW
23
        parent::__construct($hasher);
×
24
    }
25

26
    #[Authorize]
27
    public function process(
28
        #[Model] Tenant $tenant = new Tenant(),
29
    ): string {
NEW
30
        if ($tenant->id !== $this->getTenantId()) {
×
NEW
31
            return $this->templateEngine->apply(
×
NEW
32
                "400",
×
NEW
33
                new BadRequestContext(message: "Wrong account")
×
NEW
34
            );
×
35
        }
36

NEW
37
        $this->tenantService->deleteAllData($this->getTenantId());
×
38

NEW
39
        return $this->templateEngine->apply(
×
NEW
40
            "logout",
×
NEW
41
            new AccountDeleteSuccessContext(
×
NEW
42
                message: "Logging out..."
×
NEW
43
            ),
×
NEW
44
        );
×
45
    }
46
}
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