StaticPublisherTestPageController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A json() 0 5 1
1
<?php
2
3
namespace SilverStripe\StaticPublishQueue\Test\StaticPublisherTest\Controller;
4
5
use PageController;
0 ignored issues
show
Bug introduced by
The type PageController was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use SilverStripe\Control\HTTPResponse;
7
use SilverStripe\Dev\TestOnly;
8
9
class StaticPublisherTestPageController extends PageController implements TestOnly
10
{
11
    /**
12
     * @var array
13
     * @config
14
     */
15
    private static $allowed_actions = ['json'];
0 ignored issues
show
introduced by
The private property $allowed_actions is not used, and could be removed.
Loading history...
16
17
    /**
18
     * @return HTTPResponse
19
     */
20
    public function json()
21
    {
22
        $response = new HTTPResponse('{"firstName": "John"}');
23
        $response->addHeader('Content-Type', 'application/json');
24
        return $response;
25
    }
26
}
27