| Conditions | 5 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function getErrors($field = null) |
||
| 16 | { |
||
| 17 | $decoded = $this->getResponse()->json(); |
||
| 18 | |||
| 19 | $errors = []; |
||
| 20 | foreach ($decoded['errors'] as $resourceName => $errorsData) |
||
| 21 | { |
||
| 22 | foreach ($errorsData as $errorData) |
||
| 23 | { |
||
| 24 | $errorData = $errorData['error']; |
||
| 25 | if (null !== $field && $errorData['field'] !== $field) |
||
| 26 | { |
||
| 27 | continue; |
||
| 28 | } |
||
| 29 | $errors[] = new Error($errorData['code'], $errorData['field'], $errorData['description']); |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | return $errors; |
||
| 34 | } |
||
| 35 | |||
| 48 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.