From 8cc13497739250a2a0c42b6356070afb408fcc45 Mon Sep 17 00:00:00 2001 From: markhuot Date: Wed, 29 Nov 2023 00:02:44 -0500 Subject: [PATCH] pint --- src/base/SlotDefinition.php | 2 +- src/controllers/ComponentsController.php | 3 +-- src/db/Table.php | 2 ++ src/models/Component.php | 2 +- src/models/ComponentDisclosure.php | 13 ------------- 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/base/SlotDefinition.php b/src/base/SlotDefinition.php index 7057c72..15c3727 100644 --- a/src/base/SlotDefinition.php +++ b/src/base/SlotDefinition.php @@ -45,7 +45,7 @@ public function defaults(array $componentConfig): self return $this; } - public function collapsed(bool $collapsed=true): self + public function collapsed(bool $collapsed = true): self { $this->collapsed = $collapsed; diff --git a/src/controllers/ComponentsController.php b/src/controllers/ComponentsController.php index 22ca3a0..e7f300c 100644 --- a/src/controllers/ComponentsController.php +++ b/src/controllers/ComponentsController.php @@ -119,8 +119,7 @@ public function actionToggleDisclosure() if ($newState === $defaultState) { $component->disclosure->delete(); - } - else { + } else { $component->disclosure->state = $newState; $component->disclosure->save(); } diff --git a/src/db/Table.php b/src/db/Table.php index acb1d86..ea08869 100644 --- a/src/db/Table.php +++ b/src/db/Table.php @@ -5,6 +5,8 @@ class Table { const COMPONENTS = '{{%keystone_components}}'; + const COMPONENT_DATA = '{{%keystone_component_data}}'; + const COMPONENT_DISCLOSURES = '{{%keystone_component_disclosure}}'; } diff --git a/src/models/Component.php b/src/models/Component.php index 913984c..4b692bb 100644 --- a/src/models/Component.php +++ b/src/models/Component.php @@ -86,7 +86,7 @@ public function getDisclosure(): ActiveQuery return $query; } - public function withDisclosures(bool $withDisclosures=true): self + public function withDisclosures(bool $withDisclosures = true): self { $this->withDisclosures = $withDisclosures; diff --git a/src/models/ComponentDisclosure.php b/src/models/ComponentDisclosure.php index e76aa9f..88007b7 100644 --- a/src/models/ComponentDisclosure.php +++ b/src/models/ComponentDisclosure.php @@ -2,22 +2,9 @@ namespace markhuot\keystone\models; -use ArrayAccess; -use Closure; -use craft\helpers\DateTimeHelper; -use craft\helpers\Db; -use craft\helpers\StringHelper; -use Illuminate\Support\Collection; -use markhuot\keystone\base\Attribute; -use markhuot\keystone\base\FieldDefinition; use markhuot\keystone\db\ActiveRecord; use markhuot\keystone\db\Table; -use function markhuot\keystone\helpers\base\throw_if; -use function markhuot\keystone\helpers\data\data_forget; - -/** - */ class ComponentDisclosure extends ActiveRecord { public static function tableName()