Conditions | 7 |
Paths | 6 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function match($body) |
||
26 | { |
||
27 | foreach ($this->structure as $parameter) { |
||
28 | if ($parameter['in'] == "body") { |
||
29 | if (isset($parameter['required']) && $parameter['required'] === true && empty($body)) { |
||
30 | throw new RequiredArgumentNotFound('The body is required but it is empty'); |
||
31 | } |
||
32 | return $this->matchSchema($this->name, $parameter['schema'], $body); |
||
33 | } |
||
34 | } |
||
35 | |||
36 | if (!empty($body)) { |
||
37 | throw new InvalidDefinitionException('Body is passed but there is no request body definition'); |
||
38 | } |
||
39 | |||
40 | return false; |
||
41 | } |
||
42 | } |
||
43 |