| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 1 | public function execute() |
|
| 27 | { |
||
| 28 | $response = [ |
||
| 29 | 1 | 'error' => true, |
|
| 30 | 'message' => 'This route only accepts POST requests.' |
||
| 31 | ]; |
||
| 32 | |||
| 33 | // Set the response headers to indicate the method is not allowed |
||
| 34 | 1 | $this->getApplication()->setHeader('HTTP/1.1 405 Method Not Allowed', 405, true); |
|
| 35 | 1 | $this->getApplication()->setHeader('Allow', 'POST'); |
|
| 36 | |||
| 37 | 1 | $this->getApplication()->setBody(json_encode($response)); |
|
| 38 | |||
| 39 | 1 | return true; |
|
| 40 | } |
||
| 41 | } |
||
| 42 |