Commit e5fed99b authored by Harsh Panchal's avatar Harsh Panchal Committed by Mats Blakstad
Browse files

Issue #3293002 by Harsh panchal: phpcs --standard=Drupal coding issue

parent 413b4b35
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
<?php

use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
/**
 * @file
 * Implements multi_column_options_buttons widget.
 */

const MULTI_COLUMN_OPTIONS_PLUGIN_ID = 'multi_column_options_buttons';
use Drupal\Core\Config\Entity\ConfigEntityBundleBase;

/**
 * Implements hook_preprocess_radios().
@@ -20,7 +23,7 @@ function checkbox_radio_buttons_multi_columns_preprocess_checkboxes(&$variables)
        $form_display = $entity_display_repository->getFormDisplay($parameter->getEntityType()->getBundleOf(), $parameter->id());

        if (is_array($form_display->getComponent($name)) && $component = $form_display->getComponent($name)) {
          if ($component && is_array($component) && $component['type'] == MULTI_COLUMN_OPTIONS_PLUGIN_ID && isset($component['settings']['columns'])) {
          if ($component && is_array($component) && $component['type'] == 'multi_column_options_buttons' && isset($component['settings']['columns'])) {
            $columns = $component['settings']['columns'];
            $variables['attributes']['style'] = 'column-count: ' . $columns;
          }
@@ -29,4 +32,3 @@ function checkbox_radio_buttons_multi_columns_preprocess_checkboxes(&$variables)
    }
  }
}
+0 −2
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ namespace Drupal\checkbox_radio_buttons_multi_columns\Plugin\Field\FieldWidget;

use Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsButtonsWidget;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Field\FieldItemListInterface;

/**
 * Plugin implementation of the 'multi_column_options_buttons' widget.
@@ -22,7 +21,6 @@ use Drupal\Core\Field\FieldItemListInterface;
 *   multiple_values = TRUE
 * )
 */

class MultiColumnOptionsButtonsWidget extends OptionsButtonsWidget {

  /**