@@ -5,7 +5,7 @@ |
||
| 5 | 5 | |
| 6 | 6 | return static function(ECSConfig $ecsConfig): void { |
| 7 | 7 | $ecsConfig->paths([ |
| 8 | - __DIR__ . '/src', |
|
| 8 | + __DIR__.'/src', |
|
| 9 | 9 | __FILE__, |
| 10 | 10 | ]); |
| 11 | 11 | $ecsConfig->parallel(); |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | return; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $object = $event->schema->createObjectType(ucfirst($field->handle) . 'Units'); |
|
| 109 | + $object = $event->schema->createObjectType(ucfirst($field->handle).'Units'); |
|
| 110 | 110 | $object->addFloatField('value'); |
| 111 | 111 | $object->addStringField('units'); |
| 112 | 112 | |
@@ -114,6 +114,6 @@ |
||
| 114 | 114 | public static function getName($context = null): string |
| 115 | 115 | { |
| 116 | 116 | /** @var Units $context */ |
| 117 | - return $context->handle . '_UnitsData'; |
|
| 117 | + return $context->handle.'_UnitsData'; |
|
| 118 | 118 | } |
| 119 | 119 | } |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * @var int|float|null The minimum allowed number |
| 63 | 63 | */ |
| 64 | - public int|float|null $min = null; |
|
| 64 | + public int | float | null $min = null; |
|
| 65 | 65 | /** |
| 66 | 66 | * @var int|float|null The maximum allowed number |
| 67 | 67 | */ |
| 68 | - public int|float|null $max = null; |
|
| 68 | + public int | float | null $max = null; |
|
| 69 | 69 | /** |
| 70 | 70 | * @var ?int The number of digits allowed after the decimal point |
| 71 | 71 | */ |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | if (!empty($value)) { |
| 155 | 155 | // Handle a numeric value coming in (perhaps from a Number field) |
| 156 | 156 | if (is_numeric($value)) { |
| 157 | - $config['value'] = (float)$value; |
|
| 157 | + $config['value'] = (float) $value; |
|
| 158 | 158 | } elseif (is_string($value)) { |
| 159 | 159 | $config = Json::decodeIfJson($value); |
| 160 | 160 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | // Typecast it to a float |
| 166 | - $config['value'] = (float)$config['value']; |
|
| 166 | + $config['value'] = (float) $config['value']; |
|
| 167 | 167 | // Create and validate the model |
| 168 | 168 | $unitsData = new UnitsData($config); |
| 169 | 169 | if (!$unitsData->validate()) { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | 'prefix' => Craft::$app->getView()->namespaceInputId(''), |
| 227 | 227 | ]; |
| 228 | 228 | $jsonVars = Json::encode($jsonVars); |
| 229 | - Craft::$app->getView()->registerJs("$('#{$namespacedId}-field').UnitsUnits(" . $jsonVars . ");"); |
|
| 229 | + Craft::$app->getView()->registerJs("$('#{$namespacedId}-field').UnitsUnits(".$jsonVars.");"); |
|
| 230 | 230 | |
| 231 | 231 | // Render the input template |
| 232 | 232 | return Craft::$app->getView()->renderTemplate( |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | /** |
| 249 | 249 | * @inheritdoc |
| 250 | 250 | */ |
| 251 | - public function getContentGqlType(): Type|array |
|
| 251 | + public function getContentGqlType(): Type | array |
|
| 252 | 252 | { |
| 253 | 253 | $typeArray = UnitsDataGenerator::generateTypes($this); |
| 254 | 254 | |