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.
Test Setup Failed
Push — 8.x-4.x ( 3adfbe...66c90b )
by Kevin
04:48
created

df_tools_cohesion_entity_operation_alter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 7
rs 10
1
<?php
2
3
/**
4
 * @file
5
 * Contains df_tools_cohesion.module.
6
 */
7
8
use Drupal\Core\Entity\EntityInterface;
9
10
/**
11
 * Implements hook_toolbar_alter().
12
 */
13
function df_tools_cohesion_toolbar_alter(&$items) {
14
  $items['administration']['#attached']['library'][] = 'df_tools_cohesion/toolbar';
15
}
16
17
/**
18
 * Implements hook_entity_operation().
19
 */
20
function df_tools_cohesion_entity_operation_alter(array &$operations, EntityInterface $entity) {
21
  // Removes the clone operation from Entity clone for all Site Studio entity types.
22
  // Site Studio has a duplicate operation that should be used instead.
23
  $regex = '/cohesion_*/';
24
  $entityTypeId = $entity->getEntityTypeId();
25
  if (preg_match($regex, $entityTypeId)) {
26
    unset($operations['clone']);
27
  }
28
}
29