Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
10 / 10 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| ScopeEmergency | |
100.00% |
10 / 10 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
1 / 1 |
| readResponse | |
100.00% |
10 / 10 |
|
100.00% |
1 / 1 |
3 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @package Zmsadmin |
| 5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG |
| 6 | **/ |
| 7 | |
| 8 | namespace BO\Zmsadmin; |
| 9 | |
| 10 | use BO\Mellon\Validator; |
| 11 | |
| 12 | class ScopeEmergency extends BaseController |
| 13 | { |
| 14 | /** |
| 15 | * @SuppressWarnings(Param) |
| 16 | * @return String |
| 17 | */ |
| 18 | public function readResponse( |
| 19 | \Psr\Http\Message\RequestInterface $request, |
| 20 | \Psr\Http\Message\ResponseInterface $response, |
| 21 | array $args |
| 22 | ) { |
| 23 | $entityId = Validator::value($args['id'])->isNumber()->getValue(); |
| 24 | $url = sprintf('/scope/%d/emergency/', $entityId); |
| 25 | |
| 26 | switch ($request->getMethod()) { |
| 27 | case 'POST': |
| 28 | $result = \App::$http->readPostResult($url, new \BO\Zmsentities\Scope()); |
| 29 | break; |
| 30 | case 'GET': |
| 31 | $result = \App::$http->readDeleteResult($url); |
| 32 | break; |
| 33 | } |
| 34 | return $result->getResponse(); |
| 35 | } |
| 36 | } |