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.

RouteSubscriber::getSubscribedEvents()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Drupal\df_tools_workflow\Routing;
4
5
use Drupal\Core\Routing\RouteSubscriberBase;
6
use Drupal\Core\Routing\RoutingEvents;
7
use Symfony\Component\Routing\RouteCollection;
8
9
/**
10
 * Class RouteSubscriber.
11
 *
12
 * @package Drupal\df_tools_workflow\Routing
13
 * Listens to the dynamic route events.
14
 */
15
class RouteSubscriber extends RouteSubscriberBase {
16
17
  /**
18
   * {@inheritdoc}
19
   */
20
  public static function getSubscribedEvents() {
21
    $events[RoutingEvents::ALTER] = ['onAlterRoutes',-9999];  // negative Values means "late"
0 ignored issues
show
Comprehensibility Best Practice introduced by
$events was never initialized. Although not strictly required by PHP, it is generally a good practice to add $events = array(); before regardless.
Loading history...
22
    return $events;
23
  }
24
25
  /**
26
   * {@inheritdoc}
27
   */
28
  protected function alterRoutes(RouteCollection $collection) {
29
    $collection->get('entity.node.latest_version')->setRequirements([
30
      '_entity_access' => 'node.view',
31
      '_permission' => 'view latest version,view any unpublished content',
32
      'node' => "\d+",
33
      '_method' => 'GET|POST|OPTIONS'
34
    ]);
35
  }
36
}
37