Skip to content

Commit 174ebc8

Browse files
fix(php): suppress notice of JsonSerializable::jsonSerialize
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 parent 658c6e5 commit 174ebc8

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

lib/Db/Model.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use JsonSerializable;
1313
use OCP\AppFramework\Db\Entity;
14+
use ReturnTypeWillChange;
1415

1516
/**
1617
* @method string getType()
@@ -64,6 +65,7 @@ class Model extends Entity implements JsonSerializable {
6465
protected $createdAt;
6566
protected $addressType;
6667

68+
#[ReturnTypeWillChange]
6769
public function jsonSerialize(): array {
6870
return [
6971
'type' => $this->type,

lib/Service/Statistics/AppStatistics.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use JsonSerializable;
1717
use OCA\SuspiciousLogin\Db\Model;
1818
use OCA\SuspiciousLogin\Service\TrainingDataConfig;
19+
use ReturnTypeWillChange;
1920

2021
class AppStatistics implements JsonSerializable {
2122

@@ -69,7 +70,8 @@ public function getTrainingDataStatistics(): TrainingDataStatistics {
6970
return $this->trainingDataStatistics;
7071
}
7172

72-
public function jsonSerialize() {
73+
#[ReturnTypeWillChange]
74+
public function jsonSerialize(): array {
7375
return [
7476
'active' => $this->isActive(),
7577
'recentModels' => $this->getRecentModels(),

lib/Service/Statistics/TrainingDataStatistics.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace OCA\SuspiciousLogin\Service\Statistics;
1111

1212
use JsonSerializable;
13+
use ReturnTypeWillChange;
1314

1415
class TrainingDataStatistics implements JsonSerializable {
1516

@@ -39,7 +40,8 @@ public function getLoginsAggregated(): int {
3940
return $this->loginsAggregated;
4041
}
4142

42-
public function jsonSerialize() {
43+
#[ReturnTypeWillChange]
44+
public function jsonSerialize(): array {
4345
return [
4446
'loginsCaptured' => $this->getLoginsCaptured(),
4547
'loginsAggregated' => $this->getLoginsAggregated(),

lib/Service/TrainingDataConfig.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace OCA\SuspiciousLogin\Service;
1111

1212
use JsonSerializable;
13+
use ReturnTypeWillChange;
1314
use function time;
1415

1516
class TrainingDataConfig implements JsonSerializable {
@@ -89,7 +90,8 @@ public function setNow(int $now): TrainingDataConfig {
8990
return $clone;
9091
}
9192

92-
public function jsonSerialize() {
93+
#[ReturnTypeWillChange]
94+
public function jsonSerialize(): array {
9395
return [
9496
'maxAge' => $this->getMaxAge(),
9597
'threshold' => $this->getThreshold(),

0 commit comments

Comments
 (0)