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 ( b0ede2...28fbdb )
by Kevin
04:07
created

df_requirements()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 19
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 7
Bugs 0 Features 0
Metric Value
cc 3
eloc 14
c 7
b 0
f 0
nc 4
nop 1
dl 0
loc 19
rs 9.7998
1
<?php
2
3
use Drupal\user\Entity\User;
4
5
/**
6
 * @file
7
 * Contains core functionality for the DF distribution.
8
 */
9
10
/**
11
 * Implements hook_module_implements_alter().
12
 *
13
 * @todo Remove after #2635978 is fixed.
14
 */
15
function df_core_module_implements_alter(&$implementations, $hook) {
16
  // Disable block initialization/inheritance for themes enabled after Lightning
17
  // is installed in order to prevent blocks associated with the profile from
18
  // bleeding over into scenarios.
19
  if ($hook == 'themes_installed') {
20
    unset($implementations['block']);
21
  }
22
}
23
24
/**
25
 * Implements hook_menu_local_tasks_alter().
26
 */
27
function df_core_menu_local_tasks_alter(&$data, $route_name) {
0 ignored issues
show
Unused Code introduced by
The parameter $route_name 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

27
function df_core_menu_local_tasks_alter(&$data, /** @scrutinizer ignore-unused */ $route_name) {

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...
28
  // Core doesn't currently clean up local tasks created via Views when the View
29
  // is disabled/deleted. Remove the core file listing view's local tasks in
30
  // order to prevent duplicate 'Files' tabs from appear on admin/content.
31
  // @todo: remove this when https://www.drupal.org/node/2027043 is fixed.
32
  if (!empty($data['tabs'])) {
33
    foreach ($data['tabs'] as $tab_level => $tabs) {
34
      foreach ($tabs as $href => $tab_data) {
35
        if ($href == 'views_view:view.files.page_1') {
36
          $data['tabs'][$tab_level][$href]['#access'] = FALSE;
37
        }
38
      }
39
    }
40
  }
41
}
42
43
/**
44
 * Implements hook_requirements().
45
 */
46
function df_requirements($phase) {
47
  $requirements = [];
48
  if (phpversion() < '7.1') {
49
    $requirements['df_requirements'] = [
50
      'title' => t('DEMO FRAMEWORK REQUIREMENTS'),
51
      'value' => t("Your PHP installation is too old."),
52
      'description' => t("This build requires your cloud env to run PHP7.1+"),
53
      'severity' => REQUIREMENT_ERROR,
54
    ];
55
  }
56
  if ($phase == 'runtime') {
57
    $requirements['df_version'] = [
58
      'title' => t("Demo Framework"),
59
      'value' => t( "4.0.9"),
60
      'description' => 'Last Update: 2020-09-08',
61
      'severity' => REQUIREMENT_INFO,
62
    ];
63
  }
64
  return $requirements;
65
}
66
67