@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | Event::on( |
| 71 | 71 | Fields::class, |
| 72 | 72 | Fields::EVENT_REGISTER_FIELD_TYPES, |
| 73 | - function (RegisterComponentTypesEvent $event) { |
|
| 73 | + function(RegisterComponentTypesEvent $event) { |
|
| 74 | 74 | $event->types[] = Code::class; |
| 75 | 75 | } |
| 76 | 76 | ); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | Event::on( |
| 79 | 79 | Plugins::class, |
| 80 | 80 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
| 81 | - function (PluginEvent $event) { |
|
| 81 | + function(PluginEvent $event) { |
|
| 82 | 82 | if ($event->plugin === $this) { |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | ?: GqlEntityRegistry::createEntity($typeName, new CodeDataType([ |
| 53 | 53 | 'name' => $typeName, |
| 54 | 54 | 'description' => 'This entity has all the CodeData properties', |
| 55 | - 'fields' => function () use ($codeDataFields) { |
|
| 55 | + 'fields' => function() use ($codeDataFields) { |
|
| 56 | 56 | return $codeDataFields; |
| 57 | 57 | }, |
| 58 | 58 | ])); |
| 59 | 59 | |
| 60 | - TypeLoader::registerType($typeName, function () use ($codeDataType) { |
|
| 60 | + TypeLoader::registerType($typeName, function() use ($codeDataType) { |
|
| 61 | 61 | return $codeDataType; |
| 62 | 62 | }); |
| 63 | 63 | |
@@ -70,6 +70,6 @@ discard block |
||
| 70 | 70 | public static function getName($context = null): string |
| 71 | 71 | { |
| 72 | 72 | /** @var Code $context */ |
| 73 | - return $context->handle . '_CodeData'; |
|
| 73 | + return $context->handle.'_CodeData'; |
|
| 74 | 74 | } |
| 75 | 75 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function __toString(): string |
| 43 | 43 | { |
| 44 | - return (string)$this->value; |
|
| 44 | + return (string) $this->value; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | public function getSettingsHtml() |
| 178 | 178 | { |
| 179 | - $monacoLanguages = require(__DIR__ . '/MonacoLanguages.php'); |
|
| 179 | + $monacoLanguages = require(__DIR__.'/MonacoLanguages.php'); |
|
| 180 | 180 | $schemaFilePath = Craft::getAlias('@nystudio107/codefield/resources/IEditorOptionsSchema.json'); |
| 181 | 181 | $optionsSchema = @file_get_contents($schemaFilePath) ?: ''; |
| 182 | 182 | // Render the settings template |
@@ -202,14 +202,14 @@ discard block |
||
| 202 | 202 | // Extract just the languages that have been selected for display |
| 203 | 203 | $displayLanguages = []; |
| 204 | 204 | if ($this->showLanguageDropdown) { |
| 205 | - $monacoLanguages = require(__DIR__ . '/MonacoLanguages.php'); |
|
| 205 | + $monacoLanguages = require(__DIR__.'/MonacoLanguages.php'); |
|
| 206 | 206 | $decomposedLanguages = array_column($monacoLanguages, 'label', 'value'); |
| 207 | 207 | $displayLanguages = array_intersect_key($decomposedLanguages, array_flip($this->availableLanguages)); |
| 208 | 208 | // Handle "all" checkbox |
| 209 | 209 | if ($this->availableLanguages[0] === '*') { |
| 210 | 210 | $displayLanguages = $decomposedLanguages; |
| 211 | 211 | } |
| 212 | - $displayLanguages = array_map(function ($k, $v) { |
|
| 212 | + $displayLanguages = array_map(function($k, $v) { |
|
| 213 | 213 | return ['value' => $k, 'label' => $v]; |
| 214 | 214 | }, array_keys($displayLanguages), array_values($displayLanguages)); |
| 215 | 215 | } |