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 ( d31c87...fae10e )
by Kevin
05:08
created

df_tools_locations_modules_installed()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 17
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 8
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 17
rs 10
1
<?php
2
3
/**
4
 * @file
5
 * Support for locations.
6
 */
7
8
use Drupal\field\Entity\FieldConfig;
9
10
/**
11
 * Implements hook_modules_installed().
12
 */
13
function df_tools_locations_modules_installed(array $modules) {
14
  // Don't do anything during config sync.
15
  if (\Drupal::isConfigSyncing()) {
16
    return;
17
  }
18
19
  // Add support for Acquia DAM Asset media entities to the Media field if the
20
  // df_tools_media_acquiadam module is installed.
21
  if (in_array('df_tools_media_acquiadam', $modules)) {
22
    // Retrieve the location's 'media' field.
23
    $instance = FieldConfig::loadByName('node', 'location', 'field_location_media');
24
25
    // Add 'acquia_dam_asset' to the list of allowed target bundles.
26
    $settings = $instance->getSetting('handler_settings');
27
    $settings['target_bundles'][] = 'acquia_dam_asset';
28
    $instance->setSetting('handler_settings', $settings);
29
    $instance->save();
30
  }
31
}
32
33
34
35
36