Conditions | 6 |
Paths | 4 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | protected function getParam(string $key, $default = null) |
||
22 | { |
||
23 | $postParams = $this->request->getParsedBody(); |
||
24 | $getParams = $this->request->getQueryParams(); |
||
25 | $return = $default; |
||
26 | if (is_array($postParams) && array_key_exists($key, $postParams)) { |
||
27 | $return = $postParams[$key]; |
||
28 | } elseif (is_object($postParams) && property_exists($postParams, $key)) { |
||
29 | $return = $postParams->$key; |
||
30 | } elseif (isset($getParams[$key])) { |
||
31 | $return = $getParams[$key]; |
||
32 | } |
||
33 | return $return; |
||
34 | } |
||
35 | |||
46 |