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 — develop ( c1df71...dd86cc )
by
unknown
13:31 queued 08:27
created

ExceptionListener   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 31
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A duplicateRequest() 0 16 2
1
<?php
2
3
/**
4
 * Copyright 2018 SURFnet bv
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
namespace Surfnet\StepupBundle\EventListener;
20
21
use Symfony\Component\HttpFoundation\Request;
22
use Symfony\Component\HttpKernel\EventListener\ExceptionListener as CoreExceptionListener;
23
24
/**
25
 * Prepare the generic error page with detailed information for the user.
26
 */
27
class ExceptionListener extends CoreExceptionListener
28
{
29
    /**
30
     * Clones the request for the exception.
31
     *
32
     * Stepup-specific override: pass the original exception instead of the
33
     * FlattenException so we can show very speficic user messages in the
34
     * ExceptionController.
35
     *
36
     * @param \Exception $exception The thrown exception
37
     * @param Request    $request   The original request
38
     *
39
     * @return Request $request The cloned request
40
     */
41
    protected function duplicateRequest(\Exception $exception, Request $request)
42
    {
43
        $attributes = array(
44
            '_controller' => $this->controller,
45
            'exception' => $exception,
46
            'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null,
0 ignored issues
show
Bug introduced by
The class Surfnet\StepupBundle\Eve...er\DebugLoggerInterface does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
47
            // keep for BC -- as $format can be an argument of the controller callable
48
            // see src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php
49
            // @deprecated since version 2.4, to be removed in 3.0
50
            'format' => $request->getRequestFormat(),
51
        );
52
        $request = $request->duplicate(null, null, $attributes);
53
        $request->setMethod('GET');
54
55
        return $request;
56
    }
57
}
58