Skip to content

Commit

Permalink
refactor: ECS code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jan 18, 2025
1 parent 036102b commit 5744bf7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Units.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
);
Expand All @@ -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);
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function rules(): array
['defaultMax'],
'compare',
'compareAttribute' => 'defaultMin',
'operator' => '>='
'operator' => '>=',
],
['defaultMin', 'default', 'value' => 0],
['defaultMax', 'default', 'value' => null],
Expand Down
2 changes: 1 addition & 1 deletion src/translations/en/units.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];
2 changes: 1 addition & 1 deletion src/validators/EmbeddedUnitsDataValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 5744bf7

Please # to comment.