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.
Completed
Push — 8.x-2.x ( 1125d6...158ef9 )
by Samuel
03:10
created

RouteSubscriber::alterRoutes()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 4
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 7
rs 9.4285
1
<?php
2
3
namespace Drupal\df_tools_frontend\Routing;
4
5
use Drupal\Core\Routing\RouteSubscriberBase;
6
use Symfony\Component\Routing\RouteCollection;
7
8
/**
9
 * Uses the frontend theme for Lightning Media routes, to be consistent with
10
 * Content Browser and Panels IPE.
11
 */
12
class RouteSubscriber extends RouteSubscriberBase {
13
14
  /**
15
   * {@inheritdoc}
16
   */
17
  public function alterRoutes(RouteCollection $collection) {
18
    foreach (['entity_browser.media_browser', 'entity_browser.image_browser', 'entity_browser.media_browser_in_modal'] as $name) {
19
      if ($route = $collection->get($name)) {
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $route is correct as $collection->get($name) (which targets Symfony\Component\Routing\RouteCollection::get()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
20
        $route->setOption('_admin_route', FALSE);
21
      }
22
    }
23
  }
24
25
}
26