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.

BackProjectHandler::getResponse()   A
last analyzed

Complexity

Conditions 4
Paths 4

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 12
nc 4
nop 1
dl 0
loc 18
rs 9.2
c 0
b 0
f 0
1
<?php
2
namespace Afrittella\BackProject\Exceptions;
3
4
use Afrittella\BackProject\Exceptions\NotFoundException;
5
use Afrittella\BackProject\Exceptions\NotSavedException;
6
use Afrittella\BackProject\Exceptions\NotDeletedException;
7
8
class BackProjectHandler
9
{
10
    public static function getResponse($exception)
11
    {
12
        switch ($exception) {
13
            case ($exception instanceof NotFoundException):
14
                return response()->view('errors.404', ['exception' => $exception], 404);
15
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
16
17
            case ($exception instanceof NotSavedException):
18
                return response()->view('errors.500', ['exception' => $exception], 500);
19
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
20
21
            case ($exception instanceof NotDeletedException):
22
                return response()->view('errors.500', ['exception' => $exception], 500);
23
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
24
        }
25
26
        return false;
27
    }
28
}