|
12 | 12 | use OCP\AppFramework\Db\Entity; |
13 | 13 |
|
14 | 14 | /** |
| 15 | + * @psalm-method int<1, max> getId() |
15 | 16 | * @method void setName(string $name) |
16 | 17 | * @method string getName() |
| 18 | + * @psalm-method non-empty-string getName() |
17 | 19 | * @method void setUrl(string $url) |
18 | 20 | * @method string getUrl() |
| 21 | + * @psalm-method non-empty-string getUrl() |
19 | 22 | * @method void setUrlHash(string $urlHash) |
20 | 23 | * @method string getUrlHash() |
| 24 | + * @psalm-method non-empty-string getUrlHash() |
21 | 25 | * @method void setDescription(?string $description) |
22 | 26 | * @method null|string getDescription() |
23 | 27 | * @method void setSecret(string $secret) |
24 | 28 | * @method string getSecret() |
| 29 | + * @psalm-method non-empty-string getSecret() |
25 | 30 | * @method void setErrorCount(int $errorCount) |
26 | 31 | * @method int getErrorCount() |
| 32 | + * @psalm-method int<0, max> getErrorCount() |
27 | 33 | * @method void setLastErrorDate(?\DateTimeImmutable $lastErrorDate) |
28 | | - * @method ?\DateTimeImmutable getLastErrorDate() |
| 34 | + * @method null|\DateTimeImmutable getLastErrorDate() |
29 | 35 | * @method void setLastErrorMessage(string $lastErrorMessage) |
30 | 36 | * @method string getLastErrorMessage() |
31 | 37 | * @method void setState(int $state) |
32 | 38 | * @method int getState() |
| 39 | + * @psalm-method Bot::STATE_* getState() |
33 | 40 | * @method void setFeatures(int $features) |
34 | 41 | * @method int getFeatures() |
| 42 | + * @psalm-method int-mask<1, 2> getFeatures() |
35 | 43 | * |
36 | 44 | * @psalm-import-type TalkBotWithDetailsAndSecret from ResponseDefinitions |
37 | 45 | */ |
@@ -72,7 +80,7 @@ public function jsonSerialize(): array { |
72 | 80 | 'description' => $this->getDescription(), |
73 | 81 | 'secret' => $this->getSecret(), |
74 | 82 | 'error_count' => $this->getErrorCount(), |
75 | | - 'last_error_date' => $this->getLastErrorDate() ? $this->getLastErrorDate()->getTimestamp() : 0, |
| 83 | + 'last_error_date' => $this->getLastErrorDate() ? max(0, $this->getLastErrorDate()->getTimestamp()) : 0, |
76 | 84 | 'last_error_message' => $this->getLastErrorMessage(), |
77 | 85 | 'state' => $this->getState(), |
78 | 86 | 'features' => $this->getFeatures(), |
|
0 commit comments