Completed
Pull Request — master (#70)
by Daniel
01:51
created

StaticPublisherTestPageController::json()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
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