From 0187a3ce36ff5fe76c1cfffdec6a3651e18db7cf Mon Sep 17 00:00:00 2001 From: Pierre <pierredureau@yahoo.fr> Date: Wed, 1 May 2024 18:24:32 +0200 Subject: [PATCH] Multi-line function declarations must have a trailing comma after the last parameter. See #3295249 --- modules/ui_patterns_legacy/src/ComponentDiscovery.php | 4 ++-- .../src/Drush/Commands/UiPatternsLegacyCommands.php | 2 +- src/Element/ComponentForm.php | 8 ++++---- src/Form/ComponentSettingsFormBuilderTrait.php | 2 +- .../UiPatterns/PropTypeAdapter/NamespacedAttributes.php | 2 +- src/Plugin/UiPatterns/Source/MenuSource.php | 2 +- src/SourcePluginBase.php | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/ui_patterns_legacy/src/ComponentDiscovery.php b/modules/ui_patterns_legacy/src/ComponentDiscovery.php index b346f06a3..17f766443 100644 --- a/modules/ui_patterns_legacy/src/ComponentDiscovery.php +++ b/modules/ui_patterns_legacy/src/ComponentDiscovery.php @@ -33,8 +33,8 @@ class ComponentDiscovery { public function __construct( protected ExtensionPathResolver $pathResolver, protected ModuleHandlerInterface $moduleHandler, - protected FileSystemInterface $filesystem - ) { + protected FileSystemInterface $filesystem, + ) { } /** diff --git a/modules/ui_patterns_legacy/src/Drush/Commands/UiPatternsLegacyCommands.php b/modules/ui_patterns_legacy/src/Drush/Commands/UiPatternsLegacyCommands.php index 170edfb07..68d8be80a 100644 --- a/modules/ui_patterns_legacy/src/Drush/Commands/UiPatternsLegacyCommands.php +++ b/modules/ui_patterns_legacy/src/Drush/Commands/UiPatternsLegacyCommands.php @@ -23,7 +23,7 @@ final class UiPatternsLegacyCommands extends DrushCommands { private readonly ComponentConverter $converter, private readonly ComponentDiscovery $discovery, private readonly ComponentWriter $writer, - private readonly CachedDiscoveryInterface $componentsManager + private readonly CachedDiscoveryInterface $componentsManager, ) { parent::__construct(); } diff --git a/src/Element/ComponentForm.php b/src/Element/ComponentForm.php index bc391d1f8..d0fb33479 100644 --- a/src/Element/ComponentForm.php +++ b/src/Element/ComponentForm.php @@ -130,7 +130,7 @@ class ComponentForm extends ComponentFormBase { private static function buildComponentForm( array $element, string $wrapper_id, - ?string $component_id + ?string $component_id, ): array { $form = [ '#type' => 'container', @@ -157,7 +157,7 @@ class ComponentForm extends ComponentFormBase { */ private static function buildComponentSelectorForm( ?string $wrapper_id, - ?string $selected_component_id + ?string $selected_component_id, ): array { $definition_groups = \Drupal::service("plugin.manager.sdc")->getGroupedDefinitions(); $options = []; @@ -192,7 +192,7 @@ class ComponentForm extends ComponentFormBase { */ private static function buildComponentVariantSelectorForm( array $element, - string|NULL $default_variant_id + string|NULL $default_variant_id, ): array { $component = self::getComponent($element); $definition = $component->getPluginDefinition(); @@ -250,7 +250,7 @@ class ComponentForm extends ComponentFormBase { */ public static function changeSelectorFormChangeAjax( array $form, - FormStateInterface $form_state + FormStateInterface $form_state, ) { $parents = $form_state->getTriggeringElement()['#array_parents']; $sub_form = NestedArray::getValue($form, array_slice($parents, 0, -1)); diff --git a/src/Form/ComponentSettingsFormBuilderTrait.php b/src/Form/ComponentSettingsFormBuilderTrait.php index 446c8aa78..d7fecdc60 100644 --- a/src/Form/ComponentSettingsFormBuilderTrait.php +++ b/src/Form/ComponentSettingsFormBuilderTrait.php @@ -37,7 +37,7 @@ trait ComponentSettingsFormBuilderTrait { protected function componentSettingsForm( array $form, FormStateInterface $form_state, - $source_contexts = [] + $source_contexts = [], ): array { return $this->buildComponentsForm($form_state, $source_contexts); } diff --git a/src/Plugin/UiPatterns/PropTypeAdapter/NamespacedAttributes.php b/src/Plugin/UiPatterns/PropTypeAdapter/NamespacedAttributes.php index 0e1b220f0..bf4b71ed2 100644 --- a/src/Plugin/UiPatterns/PropTypeAdapter/NamespacedAttributes.php +++ b/src/Plugin/UiPatterns/PropTypeAdapter/NamespacedAttributes.php @@ -13,7 +13,7 @@ use Drupal\ui_patterns\PropTypeAdapterPluginBase; * @PropTypeAdapter( * id = "ns_attributes", * label = @Translation("Attributes (PHP namespace)"), - * description = @Translation("SDC allows PHP namespaces as prop type."), + * description = @Translation("SDC allows PHP namespaces as JSON schema types."), * prop_type = "attributes", * schema = { * "type": { diff --git a/src/Plugin/UiPatterns/Source/MenuSource.php b/src/Plugin/UiPatterns/Source/MenuSource.php index 17c67e9ac..83129b35e 100644 --- a/src/Plugin/UiPatterns/Source/MenuSource.php +++ b/src/Plugin/UiPatterns/Source/MenuSource.php @@ -59,7 +59,7 @@ class MenuSource extends SourcePluginBase { ContainerInterface $container, array $configuration, $plugin_id, - $plugin_definition + $plugin_definition, ) { $plugin = parent::create( $container, diff --git a/src/SourcePluginBase.php b/src/SourcePluginBase.php index 30ef38ae2..b093a5f6f 100644 --- a/src/SourcePluginBase.php +++ b/src/SourcePluginBase.php @@ -80,7 +80,7 @@ abstract class SourcePluginBase extends PluginBase implements ContainerInterface $container, array $configuration, $plugin_id, - $plugin_definition + $plugin_definition, ) { return new static( $configuration, @@ -97,7 +97,7 @@ abstract class SourcePluginBase extends PluginBase implements array $configuration, $plugin_id, $plugin_definition, - protected ContextRepositoryInterface $contextRepository + protected ContextRepositoryInterface $contextRepository, ) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->setConfiguration($configuration); -- GitLab