From 5744bf74e79a12176dc4fc9e3d40be5e984fb58a Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Sat, 18 Jan 2025 13:37:23 -0500 Subject: [PATCH] refactor: ECS code cleanup --- src/Units.php | 6 +++--- src/models/Settings.php | 2 +- src/translations/en/units.php | 2 +- src/validators/EmbeddedUnitsDataValidator.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Units.php b/src/Units.php index 70ad55c..a21aa69 100644 --- a/src/Units.php +++ b/src/Units.php @@ -76,7 +76,7 @@ public function init(): void Event::on( Fields::class, Fields::EVENT_REGISTER_FIELD_TYPES, - static function (RegisterComponentTypesEvent $event) { + static function(RegisterComponentTypesEvent $event) { $event->types[] = UnitsField::class; } ); @@ -85,7 +85,7 @@ static function (RegisterComponentTypesEvent $event) { Event::on( CraftVariable::class, CraftVariable::EVENT_INIT, - static function (Event $event) { + static function(Event $event) { /** @var CraftVariable $variable */ $variable = $event->sender; $variable->set('units', self::$variable); @@ -95,7 +95,7 @@ static function (Event $event) { Event::on( UnitsField::class, 'craftQlGetFieldSchema', - static function ($event) { + static function($event) { $field = $event->sender; if (!$field instanceof UnitsField) { diff --git a/src/models/Settings.php b/src/models/Settings.php index a497f3f..742acdd 100644 --- a/src/models/Settings.php +++ b/src/models/Settings.php @@ -86,7 +86,7 @@ public function rules(): array ['defaultMax'], 'compare', 'compareAttribute' => 'defaultMin', - 'operator' => '>=' + 'operator' => '>=', ], ['defaultMin', 'default', 'value' => 0], ['defaultMax', 'default', 'value' => null], diff --git a/src/translations/en/units.php b/src/translations/en/units.php index fddca9a..bba8f96 100644 --- a/src/translations/en/units.php +++ b/src/translations/en/units.php @@ -34,5 +34,5 @@ 'UnitsData failed validation: ' => 'UnitsData failed validation: ', 'Default Decimal Points' => 'Default Decimal Points', 'Default Units' => 'Default Units', - 'Default settings for newly created Units fields' => 'Default settings for newly created Units fields' + 'Default settings for newly created Units fields' => 'Default settings for newly created Units fields', ]; diff --git a/src/validators/EmbeddedUnitsDataValidator.php b/src/validators/EmbeddedUnitsDataValidator.php index 0acebdf..7a3d3f5 100644 --- a/src/validators/EmbeddedUnitsDataValidator.php +++ b/src/validators/EmbeddedUnitsDataValidator.php @@ -104,7 +104,7 @@ protected function normalizeMinMax(UnitsData $unitsData) { $config = [ 'unitsClass' => $unitsData->unitsClass, - 'units' => $this->units + 'units' => $this->units, ]; // Normalize the min if (!empty($this->min)) {