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 ( 58d96f...eefe5c )
by Brant
08:17
created

df_requirements()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
c 2
b 0
f 0
nc 2
nop 1
dl 0
loc 10
rs 9.9332
1
<?php
2
3
use Drupal\user\Entity\User;
0 ignored issues
show
Bug introduced by
This use statement conflicts with another class in this namespace, User. Consider defining an alias.

Let?s assume that you have a directory layout like this:

.
|-- OtherDir
|   |-- Bar.php
|   `-- Foo.php
`-- SomeDir
    `-- Foo.php

and let?s assume the following content of Bar.php:

// Bar.php
namespace OtherDir;

use SomeDir\Foo; // This now conflicts the class OtherDir\Foo

If both files OtherDir/Foo.php and SomeDir/Foo.php are loaded in the same runtime, you will see a PHP error such as the following:

PHP Fatal error:  Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php

However, as OtherDir/Foo.php does not necessarily have to be loaded and the error is only triggered if it is loaded before OtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias:

// Bar.php
namespace OtherDir;

use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
Loading history...
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) {
0 ignored issues
show
Unused Code introduced by
The parameter $phase 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

46
function df_requirements(/** @scrutinizer ignore-unused */ $phase) {

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...
47
  if (phpversion() < '7.1') {
48
    $requirements = [];
49
    $requirements['df_requirements'] = [
50
      'title' => t('DF 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
    return $requirements;
56
  }
57
}
58