Passed
Push — master ( ed3a21...c78a04 )
by Guido
06:24
created

Index   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
dl 0
loc 18
c 4
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A cacheType() 0 3 1
A opcache() 0 3 1
A index() 0 6 1
1
<?php
2
namespace Gvera\Controllers;
3
4
use Gvera\Cache\Cache;
5
use Gvera\Helpers\http\JSONResponse;
6
7
/**
8
 * Controller Class Doc Comment
9
 *
10
 * @category Class
11
 * @package  Controllers
12
 * @author   Guido Vera <[email protected]>
13
 * @license  http://www.gnu.org/copyleft/gpl.html GNU General Public License
14
 * @link     http://www.github.com/veraguido/gv
15
 */
16
class Index extends GvController
17
{
18
    public function index()
19
    {
20
        $welcomeJson = [
21
            'gv' => ["Hello there :)"]
22
            ];
23
        $this->httpResponse->response(new JSONResponse($welcomeJson));
24
    }
25
26
    public function cacheType()
27
    {
28
        $this->httpResponse->response(new JSONResponse(["cache" => get_class(Cache::getCache())]));
29
    }
30
31
    public function opcache()
32
    {
33
        $this->httpResponse->response(new JSONResponse(["opcache_enabled" => opcache_get_status()['opcache_enabled']]));
34
    }
35
}
36