Issues (52)

src/Controllers/DevHealthController.php (1 issue)

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
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