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