Passed
Push — 4 ( 29943f...c31de7 )
by Guy
08:24 queued 10s
created

HTTPMethodTestController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRoot() 0 3 1
A postLegacyRoot() 0 3 1
1
<?php
2
3
namespace SilverStripe\Control\Tests\RequestHandlingTest;
4
5
use SilverStripe\Control\Controller;
6
use SilverStripe\Control\HTTPRequest;
7
use SilverStripe\Dev\TestOnly;
8
9
class HTTPMethodTestController extends Controller implements TestOnly
10
{
11
    private static $url_segment = 'HTTPMethodTestController';
0 ignored issues
show
introduced by
The private property $url_segment is not used, and could be removed.
Loading history...
12
13
    private static $url_handlers = [
0 ignored issues
show
introduced by
The private property $url_handlers is not used, and could be removed.
Loading history...
14
        'GET /' => 'getRoot',
15
        'POST ' => 'postLegacyRoot',
16
    ];
17
18
    private static $allowed_actions = [
0 ignored issues
show
introduced by
The private property $allowed_actions is not used, and could be removed.
Loading history...
19
        'getRoot',
20
        'postLegacyRoot',
21
    ];
22
23
    public function getRoot(HTTPRequest $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

23
    public function getRoot(/** @scrutinizer ignore-unused */ HTTPRequest $request)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
24
    {
25
        return "Routed to getRoot";
26
    }
27
28
    public function postLegacyRoot(HTTPRequest $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

28
    public function postLegacyRoot(/** @scrutinizer ignore-unused */ HTTPRequest $request)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    {
30
        return "Routed to postLegacyRoot";
31
    }
32
}
33