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

lmc-eu / matej-client-php / 7529439147

15 Jan 2024 01:18PM UTC coverage: 100.0%. Remained the same
7529439147

Pull #145

github

web-flow
Bump actions/checkout from 3 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #145: Bump actions/checkout from 3 to 4

712 of 712 relevant lines covered (100.0%)

35.03 hits per line

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

100.0
/src/Model/Command/UserForget.php
1
<?php declare(strict_types=1);
2

3
namespace Lmc\Matej\Model\Command;
4

5
use Lmc\Matej\Model\Assertion;
6
use Lmc\Matej\Model\Command\Constants\UserForgetMethod;
7

8
/**
9
 * UserForget any user in Matej, either by anonymizing or by deleting their entries.
10
 * Anonymization and deletion is done server-side, and is GDPR-compliant. When anonymizing the data, new user-id is
11
 * generated server-side and client library won't ever know it.
12
 */
13
class UserForget extends AbstractCommand implements UserAwareInterface
14
{
15
    /** @var string */
16
    private $userId;
17
    /** @var UserForgetMethod */
18
    private $method;
19

20
    private function __construct(string $userId, UserForgetMethod $method)
21
    {
22
        $this->setUserId($userId);
7✔
23
        $this->method = $method;
7✔
24
    }
25

26
    /**
27
     * Anonymize all user data in Matej.
28
     */
29
    public static function anonymize(string $userId): self
30
    {
31
        return new static($userId, UserForgetMethod::ANONYMIZE());
7✔
32
    }
33

34
    /**
35
     * Completely wipe all user data from Matej.
36
     */
37
    public static function delete(string $userId): self
38
    {
39
        return new static($userId, UserForgetMethod::DELETE());
7✔
40
    }
41

42
    public function getUserId(): string
43
    {
44
        return $this->userId;
7✔
45
    }
46

47
    public function getForgetMethod(): UserForgetMethod
48
    {
49
        return $this->method;
7✔
50
    }
51

52
    protected function setUserId(string $userId): void
53
    {
54
        Assertion::typeIdentifier($userId);
7✔
55

56
        $this->userId = $userId;
7✔
57
    }
58

59
    protected function getCommandType(): string
60
    {
61
        return 'user-forget';
7✔
62
    }
63

64
    protected function getCommandParameters(): array
65
    {
66
        return [
7✔
67
            'user_id' => $this->userId,
7✔
68
            'method' => $this->method->jsonSerialize(),
7✔
69
        ];
7✔
70
    }
71
}
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

© 2025 Coveralls, Inc