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.

GenericRepresentationController::options()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace Solvire\API\Representatives;
3
4
/**
5
 * Providing some basic CRUD level stuff
6
 *
7
 * @author solvire <[email protected]>
8
 * @package RepresentationControllers
9
 * @namespace namespace Solvire\API\Representatives;
10
 */
11
class GenericRepresentationController extends BaseRepresentationController
12
{
13
14
    protected $availableMethods = [
15
        'GET',
16
        'POST',
17
        'PUT',
18
        'DELETE',
19
        'OPTIONS'
20
    ];
21
22
    protected $recordCount = 0;
23
24
    protected $hasMorePages = false;
25
26
    protected $isEmpty = true;
27
28
    /**
29
     */
30
//     public function recordCount()
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
31
//     {
32
//         return $this->recordCount();
33
//     }
34
35
//     public function hasMorePages()
0 ignored issues
show
Unused Code Comprehensibility introduced by
46% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
36
//     {
37
//         return (boolean) $this->hasMorePages;
38
//     }
39
40 1
    public function process()
41
    {
42 1
        $method = $this->request->getMethod();
43 1
        $this->renderer->setRequest($this->request);
44 1
        $this->renderer->setSerializer($this->serializer);
45
        
46
        // check to make sure the method exists for the renderer has the method
47
        // for instance if it's List obj then we will have the appropriate render functions.
48
        // if we have a List and we call a put render
49
        switch ($method) {
50
            
51 1
            case 'GET':
52 1
                return $this->get();
53
                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...
54 1
            case 'POST':
55 1
                return $this->post();
56
                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...
57 1
            case 'PUT':
58 1
                return $this->put();
59
                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...
60 1
            case 'DELETE':
61 1
                return $this->delete();
62
                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...
63 1
            case 'OPTIONS':
64 1
                return $this->options();
65
                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...
66 1
            default:
67 1
                throw new \RuntimeException("No Valid Method Provided");
68 1
        }
69
    }
70
    
71
72 1
    public function get()
73
    {
74 1
        throw new \RuntimeException('Not implemented');
75
    }
76
    
77 1
    public function post()
78
    {
79 1
        throw new \RuntimeException('Not implemented');
80
    }
81
    
82 1
    public function put()
83
    {
84 1
        throw new \RuntimeException('Not implemented');
85
    }
86
    
87 1
    public function delete()
88
    {
89 1
        throw new \RuntimeException('Not implemented');
90
    }
91
    
92 1
    public function options()
93
    {
94 1
        throw new \RuntimeException('Not implemented');
95
    }
96
    
97
    
98
}
99