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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResponse() 0 18 4
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
}