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-3.x-rc2 ( 195945 )
by Kevin
05:55
created

df_tools_page_modules_installed()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 17
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 7
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 17
rs 10
1
<?php
2
3
use Drupal\workflows\Entity\Workflow;
4
5
/**
6
 * Implements hook_modules_installed().
7
 */
8
function df_tools_page_modules_installed(array $modules) {
9
  if (Drupal::isConfigSyncing()) {
10
    return;
11
  }
12
13
  /**
14
   * Add Basic Page to editorial workflow. 
15
   * Correct changes to Lightning 3.1.5
16
   * https://www.drupal.org/node/2984737 
17
   */
18
19
  if (in_array('df_tools_workflow', $modules, TRUE)) {
20
    $workflow = Workflow::load('editorial');
21
    /** @var \Drupal\content_moderation\Plugin\WorkflowType\ContentModerationInterface $plugin */
22
    $plugin = $workflow->getTypePlugin();
23
    $plugin->addEntityTypeAndBundle('node', 'page');
24
    $workflow->save();
25
  }
26
}