| Total Complexity | 2 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | trait ValidateMetaObject |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Assert that a json fragment is a valid meta object. |
||
| 16 | * |
||
| 17 | * It will do the following checks : |
||
| 18 | * 1) validates that the meta object is not an array of objects (@see mustNotBeArrayOfObjects). |
||
| 19 | * 2) validates that each member of the meta object is valid (@see validateMemberName). |
||
| 20 | * |
||
| 21 | * @param array $json |
||
| 22 | * @param boolean $strict If true, unsafe characters are not allowed when checking members name. |
||
| 23 | * |
||
| 24 | * @return void |
||
| 25 | * @throws \VGirol\JsonApiStructure\Exception\ValidationException |
||
| 26 | */ |
||
| 27 | 75 | public function validateMetaObject($json, bool $strict): void |
|
| 36 |