JsonApiController::indexAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
nc 1
nop 0
dl 0
loc 10
c 1
b 0
f 0
cc 1
ccs 7
cts 7
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Anax\Weather;
4
5
use Anax\Commons\ContainerInjectableInterface;
6
use Anax\Commons\ContainerInjectableTrait;
7
use Anax\Route\Exception\NotFoundException;
8
9
/**
10
 * A controller to ease with development and debugging information.
11
 */
12
class JsonApiController implements ContainerInjectableInterface
13
{
14
    use ContainerInjectableTrait;
15
16 1
    public function indexAction() : array
17
    {
18 1
        $city = $this->di->request->getGet("city");
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...
19 1
        $cnt = $this->di->request->getGet("cnt");
20 1
        $weatherModel = $this->di->get("weatherhelper");
21 1
        $days = explode(" ", $cnt);
22
23 1
        $info = $weatherModel->getUsersThroughMultiCurl($days, $city);
24
25 1
        return [$info];
26
    }
27
}
28