MakeJsonController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A indexAction() 0 6 1
1
<?php
2
namespace Anax\Controller;
3
use Anax\Commons\ContainerInjectableInterface;
4
use Anax\Commons\ContainerInjectableTrait;
5
// use Anax\Route\Exception\ForbiddenException;
6
// use Anax\Route\Exception\NotFoundException;
7
// use Anax\Route\Exception\InternalErrorException;
8
/**
9
 * A sample controller to show how a controller class can be implemented.
10
 */
11
class MakeJsonController implements ContainerInjectableInterface
12
{
13
    use ContainerInjectableTrait;
14
    /**
15
     * This is the index method action, it handles:
16
     * ANY METHOD mountpoint
17
     *
18
     * @return array
19
     */
20 1
    public function indexAction() : array
21
    {
22 1
        $ip = $this->di->request->getGet("ip");
0 ignored issues
show
Bug introduced by
Accessing request on the interface Psr\Container\ContainerInterface suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
23 1
        $ipvalidator = new \Anax\Model\IpValidation;
24 1
        $json = $ipvalidator->toJson($ip);
25 1
        return [$json];
26
    }
27
}
28