Conditions | 7 |
Paths | 5 |
Total Lines | 22 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 56 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | protected function restForwarding(): bool |
||
37 | { |
||
38 | $id = $this->getParam('id', [Filter::FILTER_ALNUM]); |
||
39 | if ($this->request->isPost() || $this->request->isPut() || $this->request->isPatch()) { |
||
40 | $this->dispatcher->forward(['action' => 'save']); |
||
41 | return true; |
||
42 | } |
||
43 | else if ($this->request->isDelete()) { |
||
44 | $this->dispatcher->forward(['action' => 'delete']); |
||
45 | return true; |
||
46 | } |
||
47 | else if ($this->request->isGet()) { |
||
48 | if (is_null($id)) { |
||
49 | $this->dispatcher->forward(['action' => 'getList']); |
||
50 | return true; |
||
51 | } |
||
52 | else { |
||
53 | $this->dispatcher->forward(['action' => 'get']); |
||
54 | return true; |
||
55 | } |
||
56 | } |
||
57 | return false; |
||
58 | } |
||
60 |