Total Complexity | 6 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class CircuitController |
||
9 | { |
||
10 | protected $request; |
||
11 | |||
12 | public function __construct() |
||
13 | { |
||
14 | $this->request = new CircuitRequest; |
||
15 | } |
||
16 | |||
17 | public function index() |
||
18 | { |
||
19 | $response = $this->request->index(); |
||
20 | |||
21 | return response_to_collect($response, Circuit::class); |
||
22 | } |
||
23 | |||
24 | public function show($circuit) |
||
25 | { |
||
26 | $response = $this->request->show($circuit); |
||
27 | |||
28 | return new Circuit($response['data']); |
||
29 | } |
||
30 | |||
31 | public function create(array $circuit) |
||
36 | } |
||
37 | |||
38 | public function update($circuit, array $newData) |
||
39 | { |
||
40 | $response = $this->request->update($circuit, $newData); |
||
41 | |||
42 | return (bool) $response['success']; |
||
43 | } |
||
44 | |||
45 | public function drop($circuit) |
||
50 | } |
||
51 | } |
||
52 |