GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — 8.x-4.x ( 14c6dd...0d480b )
by Brant
05:09
created

df_tools_slideshow_migration_plugins_alter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 11
rs 10
1
<?php
2
3
/**
4
 * @file
5
 * Set up the DF Tools Slideshow module.
6
 */
7
8
/**
9
 * Implements hook_form_FORM_ID_alter().
10
 */
11
function df_tools_slideshow_form_block_content_slideshow_panels_ipe_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
0 ignored issues
show
Unused Code introduced by
The parameter $form_id is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

11
function df_tools_slideshow_form_block_content_slideshow_panels_ipe_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, /** @scrutinizer ignore-unused */ $form_id) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $form_state is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

11
function df_tools_slideshow_form_block_content_slideshow_panels_ipe_form_alter(&$form, /** @scrutinizer ignore-unused */ \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
12
  $form['#attributes']['class'][] = 'df-tools-slideshow-form';
13
  // Remove unneeded title added to field.
14
  $form['field_block']['widget']['#title'] = '';
15
  // Add default styling to the inline form.
16
  $form['field_block']['widget']['#title'] = t('Add slide');
17
  $form['field_block']['widget']['#type'] = 'fieldset';
18
  $form['field_block']['widget']['#attributes'] = ['class' => ['fieldset']];
19
  if (isset($form['field_block']['widget']['form'])) {
20
    $widget_form = &$form['field_block']['widget']['form'];
21
    // Existing.
22
    if (isset($widget_form['entity_id'])) {
23
      $widget_form['#title'] = '';
24
      $widget_form['entity_id']['#title'] = t('Existing slide');
25
      $widget_form['actions']['ief_reference_save']['#value'] = t('Add');
26
    }
27
    else {
28
      $widget_form['inline_entity_form']['#ief_labels']['singular'] = 'slide';
29
    }
30
  }
31
  if (isset($form['field_block']['widget']['actions']['ief_add'])) {
32
    $label = t('Add a new slide');
33
    $form['field_block']['widget']['actions']['ief_add']['#value'] = $label;
34
  }
35
  if (isset($form['field_block']['widget']['actions']['ief_add_existing'])) {
36
    $label = t('Add existing slide');
37
    $form['field_block']['widget']['actions']['ief_add_existing']['#value'] = $label;
38
  }
39
}
40