DevHealthController::index()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SilverStripe\EnvironmentCheck\Controllers;
4
5
use SilverStripe\Control\Controller;
6
use SilverStripe\Control\HTTPResponse_Exception;
7
use SilverStripe\EnvironmentCheck\EnvironmentChecker;
8
9
/**
10
 * Class DevHealthController
11
 *
12
 * @package environmentcheck
13
 */
14
class DevHealthController extends Controller
15
{
16
    /**
17
     * @var array
18
     */
19
    private static $allowed_actions = [
0 ignored issues
show
introduced by
The private property $allowed_actions is not used, and could be removed.
Loading history...
20
        'index'
21
    ];
22
23
    /**
24
     * @return EnvironmentChecker
25
     *
26
     * @throws HTTPResponse_Exception
27
     */
28
    public function index()
29
    {
30
        // health check does not require permission to run
31
32
        $checker = new EnvironmentChecker('health', 'Site health');
33
        $checker->setErrorCode(500);
34
35
        return $checker;
36
    }
37
}
38