Completed
Pull Request — master (#70)
by Daniel
04:46
created

StaticPublisherTestPageController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A json() 0 6 1
1
<?php
2
3
namespace SilverStripe\StaticPublishQueue\Test\StaticPublisherTest\Controller;
4
5
use PageController;
6
use SilverStripe\Control\HTTPResponse;
7
use SilverStripe\Dev\TestOnly;
8
9
class StaticPublisherTestPageController extends PageController implements TestOnly
10
{
11
12
    /**
13
     * @var array
14
     * @config
15
     */
16
    private static $allowed_actions = array('json');
0 ignored issues
show
Unused Code introduced by
The property $allowed_actions is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
17
18
    /**
19
     * @return HTTPResponse
20
     */
21
    public function json()
22
    {
23
        $response = new HTTPResponse('{"firstName": "John"}');
24
        $response->addHeader('Content-Type', 'application/json');
25
        return $response;
26
    }
27
}
28