ApiController::indexAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
nc 1
nop 0
dl 0
loc 10
c 1
b 0
f 0
cc 1
ccs 8
cts 8
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Bjos\Api;
4
5
use Anax\Commons\ContainerInjectableInterface;
6
use Anax\Commons\ContainerInjectableTrait;
7
8
/**
9
 * A test controller to show off using a model.
10
 */
11
class ApiController implements ContainerInjectableInterface
12
{
13
    use ContainerInjectableTrait;
14
15
    /**
16
     * Page to show all Apis.
17
     */
18 1
    public function indexAction()
19
    {
20 1
        $page = $this->di->get("page");
21 1
        $geo = $this->di->get("geolocation");
22 1
        $userIp = $geo->getUserIp();
23 1
        $page->add("bjos/api/allapi", [
24 1
            "userIp" => $userIp
25
        ]);
26 1
        return $page->render([
27 1
            "title" => "All Api",
28
        ]);
29
    }
30
}
31