Completed
Push — master ( 10921e...c7b4fd )
by Pierre
03:00
created

Metro   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Test Coverage

Coverage 28.57%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 18
c 2
b 0
f 0
dl 0
loc 49
ccs 4
cts 14
cp 0.2857
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A stations() 0 10 1
A lines() 0 10 1
1
<?php
2
3
namespace App\Controllers\Api\V1;
4
5
use Nymfonya\Component\Container;
6
use Nymfonya\Component\Http\Response;
7
use App\Interfaces\Controllers\IApi;
8
use App\Reuse\Controllers\AbstractApi;
9
use App\Model\Repository\Metro\Lines;
10
use App\Model\Repository\Metro\Stations;
11
12
final class Metro extends AbstractApi implements IApi
13
{
14
    protected $modelLines;
15
    protected $modelStations;
16
17
    /**
18
     * instanciate
19
     *
20
     * @param Container $container
21
     */
22 1
    public function __construct(Container $container)
23
    {
24 1
        parent::__construct($container);
25 1
        $this->modelLines = new Lines($container);
26 1
        $this->modelStations = new Stations($container);
27
    }
28
29
    /**
30
     * search lines
31
     *
32
     * @return Test
33
     */
34
    final public function lines(): Metro
35
    {
36
        $this->response->setCode(Response::HTTP_OK)->setContent([
37
            Response::_ERROR => false,
38
            Response::_ERROR_MSG => '',
39
            'datas' => [
40
                'lines' => []
41
            ]
42
        ]);
43
        return $this;
44
    }
45
46
    /**
47
     * search stations
48
     *
49
     * @return Test
50
     */
51
    final public function stations(): Metro
52
    {
53
        $this->response->setCode(Response::HTTP_OK)->setContent([
54
            Response::_ERROR => false,
55
            Response::_ERROR_MSG => '',
56
            'datas' => [
57
                'stations' => []
58
            ]
59
        ]);
60
        return $this;
61
    }
62
}
63