Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
24 / 24 |
|
100.00% |
16 / 16 |
CRAP | |
100.00% |
1 / 1 |
| PushSubscriptionEntity | |
100.00% |
24 / 24 |
|
100.00% |
16 / 16 |
16 | |
100.00% |
1 / 1 |
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setId | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getUserId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setUserId | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getEndpoint | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setEndpoint | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getEndpointHash | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setEndpointHash | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getPublicKey | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setPublicKey | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getAuthToken | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setAuthToken | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getContentEncoding | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setContentEncoding | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getCreatedAt | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setCreatedAt | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * The PushSubscriptionEntity class. |
| 5 | * |
| 6 | * This Source Code Form is subject to the terms of the Mozilla Public License, |
| 7 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
| 8 | * obtain one at https://mozilla.org/MPL/2.0/. |
| 9 | * |
| 10 | * @package phpMyFAQ\Entity |
| 11 | * @author Thorsten Rinne <thorsten@phpmyfaq.de> |
| 12 | * @copyright 2026 phpMyFAQ Team |
| 13 | * @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
| 14 | * @link https://www.phpmyfaq.de |
| 15 | * @since 2026-02-02 |
| 16 | */ |
| 17 | |
| 18 | declare(strict_types=1); |
| 19 | |
| 20 | namespace phpMyFAQ\Entity; |
| 21 | |
| 22 | use DateTimeImmutable; |
| 23 | |
| 24 | class PushSubscriptionEntity |
| 25 | { |
| 26 | public int $id; |
| 27 | |
| 28 | public int $userId; |
| 29 | |
| 30 | public string $endpoint; |
| 31 | |
| 32 | public string $endpointHash; |
| 33 | |
| 34 | public string $publicKey; |
| 35 | |
| 36 | public string $authToken; |
| 37 | |
| 38 | public ?string $contentEncoding; |
| 39 | |
| 40 | public DateTimeImmutable $createdAt; |
| 41 | |
| 42 | public function getId(): int |
| 43 | { |
| 44 | return $this->id; |
| 45 | } |
| 46 | |
| 47 | public function setId(int $id): self |
| 48 | { |
| 49 | $this->id = $id; |
| 50 | return $this; |
| 51 | } |
| 52 | |
| 53 | public function getUserId(): int |
| 54 | { |
| 55 | return $this->userId; |
| 56 | } |
| 57 | |
| 58 | public function setUserId(int $userId): self |
| 59 | { |
| 60 | $this->userId = $userId; |
| 61 | return $this; |
| 62 | } |
| 63 | |
| 64 | public function getEndpoint(): string |
| 65 | { |
| 66 | return $this->endpoint; |
| 67 | } |
| 68 | |
| 69 | public function setEndpoint(string $endpoint): self |
| 70 | { |
| 71 | $this->endpoint = $endpoint; |
| 72 | return $this; |
| 73 | } |
| 74 | |
| 75 | public function getEndpointHash(): string |
| 76 | { |
| 77 | return $this->endpointHash; |
| 78 | } |
| 79 | |
| 80 | public function setEndpointHash(string $endpointHash): self |
| 81 | { |
| 82 | $this->endpointHash = $endpointHash; |
| 83 | return $this; |
| 84 | } |
| 85 | |
| 86 | public function getPublicKey(): string |
| 87 | { |
| 88 | return $this->publicKey; |
| 89 | } |
| 90 | |
| 91 | public function setPublicKey(string $publicKey): self |
| 92 | { |
| 93 | $this->publicKey = $publicKey; |
| 94 | return $this; |
| 95 | } |
| 96 | |
| 97 | public function getAuthToken(): string |
| 98 | { |
| 99 | return $this->authToken; |
| 100 | } |
| 101 | |
| 102 | public function setAuthToken(#[\SensitiveParameter] string $authToken): self |
| 103 | { |
| 104 | $this->authToken = $authToken; |
| 105 | return $this; |
| 106 | } |
| 107 | |
| 108 | public function getContentEncoding(): ?string |
| 109 | { |
| 110 | return $this->contentEncoding; |
| 111 | } |
| 112 | |
| 113 | public function setContentEncoding(?string $contentEncoding): self |
| 114 | { |
| 115 | $this->contentEncoding = $contentEncoding; |
| 116 | return $this; |
| 117 | } |
| 118 | |
| 119 | public function getCreatedAt(): DateTimeImmutable |
| 120 | { |
| 121 | return $this->createdAt; |
| 122 | } |
| 123 | |
| 124 | public function setCreatedAt(DateTimeImmutable $createdAt): self |
| 125 | { |
| 126 | $this->createdAt = $createdAt; |
| 127 | return $this; |
| 128 | } |
| 129 | } |