From b592f7979b6fb5a727659f21f127422649e27fa4 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 2 Oct 2024 15:24:38 +0200 Subject: [PATCH 1/2] fix: missing enabled attribute --- .phpactor.json | 4 ++++ src/Migration/Resources/Database/Collection.php | 8 ++++++++ src/Migration/Resources/Database/Database.php | 8 ++++++++ 3 files changed, 20 insertions(+) create mode 100644 .phpactor.json diff --git a/.phpactor.json b/.phpactor.json new file mode 100644 index 0000000..4d42bbb --- /dev/null +++ b/.phpactor.json @@ -0,0 +1,4 @@ +{ + "$schema": "/phpactor.schema.json", + "language_server_phpstan.enabled": true +} \ No newline at end of file diff --git a/src/Migration/Resources/Database/Collection.php b/src/Migration/Resources/Database/Collection.php index 1f91d5a..b928167 100644 --- a/src/Migration/Resources/Database/Collection.php +++ b/src/Migration/Resources/Database/Collection.php @@ -24,6 +24,7 @@ public function __construct( array $permissions = [], protected string $createdAt = '', protected string $updatedAt = '', + protected bool $enabled = true, ) { $this->id = $id; $this->permissions = $permissions; @@ -53,6 +54,7 @@ public static function fromArray(array $array): self permissions: $array['permissions'] ?? [], createdAt: $array['createdAt'] ?? '', updatedAt: $array['updatedAt'] ?? '', + enabled: $array['enabled'] ?? true, ); } @@ -69,6 +71,7 @@ public function jsonSerialize(): array 'permissions' => $this->permissions, 'createdAt' => $this->createdAt, 'updatedAt' => $this->updatedAt, + 'enabled' => $this->enabled, ]); } @@ -96,4 +99,9 @@ public function getDocumentSecurity(): bool { return $this->documentSecurity; } + + public function getEnabled(): bool + { + return $this->enabled; + } } diff --git a/src/Migration/Resources/Database/Database.php b/src/Migration/Resources/Database/Database.php index c2fc0bd..c297d6e 100644 --- a/src/Migration/Resources/Database/Database.php +++ b/src/Migration/Resources/Database/Database.php @@ -20,6 +20,7 @@ public function __construct( private readonly string $name = '', protected string $createdAt = '', protected string $updatedAt = '', + protected bool $enabled = true, ) { $this->id = $id; } @@ -39,6 +40,7 @@ public static function fromArray(array $array): self $array['name'], createdAt: $array['createdAt'] ?? '', updatedAt: $array['updatedAt'] ?? '', + enabled: $array['enabled'] ?? true, ); } @@ -52,6 +54,7 @@ public function jsonSerialize(): array 'name' => $this->name, 'createdAt' => $this->createdAt, 'updatedAt' => $this->updatedAt, + 'enabled' => $this->enabled, ]; } @@ -69,4 +72,9 @@ public function getDatabaseName(): string { return $this->name; } + + public function getEnabled(): bool + { + return $this->enabled; + } } From 29513de5dc62d69b362af99160de9e0ffc3b8f93 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 2 Oct 2024 15:25:23 +0200 Subject: [PATCH 2/2] chore: add .phpactor.json to .gitignore --- .gitignore | 3 ++- .phpactor.json | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 .phpactor.json diff --git a/.gitignore b/.gitignore index d16782c..3a71c86 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ test-service-account.json localBackup/ .vscode/ .env.prod -serviceAccount.json \ No newline at end of file +serviceAccount.json +.phpactor.json \ No newline at end of file diff --git a/.phpactor.json b/.phpactor.json deleted file mode 100644 index 4d42bbb..0000000 --- a/.phpactor.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "/phpactor.schema.json", - "language_server_phpstan.enabled": true -} \ No newline at end of file