JsonApiController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 14
c 1
b 0
f 0
ccs 7
cts 7
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A indexAction() 0 10 1
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