Completed
Push — master ( f8decb...0d0ae6 )
by Arnaud
15s
created

Debug   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test() 0 12 1
1
<?php
2
3
namespace App\Controllers\Ajax;
4
5
//to call, require /ajax/debug/'action'
6
use Core\AjaxController;
7
8
class Debug extends AjaxController
9
{
10
    public function test()
11
    {
12
        $referer = $this->request->getReferer();
13
        $host = $this->request->getBaseUrl();
14
15
        $jsonData = [
16
            "Referer" => $referer,
17
            "https" => $host,
18
            "Message" => 'Ok message sent'
19
        ];
20
        $result = $this->jsonResponse($jsonData);
21
        echo $result;
22
23
24
    }
25
}