Skip to content
Snippets Groups Projects

Issue #3368603: Fix the issues reported by phpcs

Files
13
@@ -20,8 +20,9 @@ function _display_fields_form_field_ui_display(&$form, FormStateInterface $form_
}
/**
* Add The fields row form, retrieving the $form from the DisplayFields Field
* plugin.
* Add The fields row form.
*
* Retrieving the $form from the DisplayFields Field plugin.
*/
function _display_fields_form_field_ui_display_fields_add_fields_row(&$form, FormStateInterface $form_state) {
$entity_type = $form['#entity_type'];
@@ -34,7 +35,7 @@ function _display_fields_form_field_ui_display_fields_add_fields_row(&$form, For
return;
}
// And an header for the delete button cell
// And an header for the delete button cell.
$form['fields']['#header'][] = ' ';
$display_fields_settings = display_fields_get_entity_view_settings($entity_type, $bundle, $view_mode);
@@ -53,7 +54,9 @@ function _display_fields_form_field_ui_display_fields_add_fields_row(&$form, For
* Submit handler for the DisplayFields rows.
*
* @param array $form
* The from array.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The from state.
*
* @throws \Drupal\Core\Entity\EntityStorageException
*/
@@ -109,7 +112,6 @@ function _display_fields_form_field_ui_display_fields_tab(&$form, FormStateInter
// Get the entity_type, bundle and view mode.
$entity_type = $form['#entity_type'];
$bundle = $form['#bundle'];
$view_mode = $form_state->getFormObject()->getEntity()->getMode();
$form_state->set('entity_type', $entity_type);
$form_state->set('bundle', $bundle);
$plugin_id = $form_state->getValue(['display_fields', 'create', 'field_type']);
@@ -234,14 +236,16 @@ function _display_fields_form_field_ui_create_display_fields_cancel($form, FormS
/**
* Submit handler for the DisplayFields fields rows plugins settings.
*
* @param $form
* @param array $form
* Form array to use.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The from state.
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
* @throws \Drupal\Core\Entity\EntityStorageException
*/
function _display_fields_form_field_ui_create_display_fields_submit($form, FormStateInterface $form_state) {
function _display_fields_form_field_ui_create_display_fields_submit(array $form, FormStateInterface $form_state) {
$plugin_id = $form['display_fields']['create']['plugin_id']['#value'];
// Get the entity_type, bundle and view mode.
$entity_type = $form['#entity_type'];
@@ -255,7 +259,7 @@ function _display_fields_form_field_ui_create_display_fields_submit($form, FormS
$values = $form_state->getValue(['display_fields', 'create']);
// Try to load the existing config for this entity_type / bundle
// Try to load the existing config for this entity_type / bundle.
$display_fields_config = DisplayFields::getDisplayFields($entity_type, $bundle);
$display_fields = $display_fields_config->get('display_fields');
@@ -280,15 +284,16 @@ function _display_fields_form_field_ui_create_display_fields_submit($form, FormS
function _display_fields_field_machine_name_exists($value, $element, $form_state) {
$entity_type = $form_state->get('entity_type');
$bundle = $form_state->get('bundle');
// Try to load the existing config for this entity_type / bundle
// Try to load the existing config for this entity_type / bundle.
$display_fields_config = DisplayFields::getDisplayFields($entity_type, $bundle);
$display_fields = $display_fields_config->get('display_fields');
return isset($display_fields[$value]);
}
/**
* Ajax callback for the display fields vertical tab UI (creation of
* DisplayFields).
* Ajax callback for the display fields vertical tab UI.
*
* Creation of DisplayFields.
*/
function _display_fields_form_field_ui_create_display_fields_callback($form, FormStateInterface $form_state) {
return $form['display_fields']['create'];
Loading