mode = $mode; $this->startIndexKeyword = $startIndexKeyword; } /** * @inheritDoc */ public function type(): string { return self::TYPE_ARRAY; } /** * @inheritDoc */ public function parse(SchemaInfo $info, \Opis\JsonSchema\Parsers\SchemaParser $parser, object $shared): ?Keyword { $schema = $info->data(); if (!$this->keywordExists($schema)) { return null; } $value = $this->keywordValue($schema); $alwaysValid = false; if (is_bool($value)) { if ($this->mode === self::ONLY_ARRAY) { throw $this->keywordException("{keyword} must contain an array of json schemas", $info); } if ($value) { $alwaysValid = true; } } elseif (is_array($value)) { if ($this->mode === self::ONLY_SCHEMA) { throw $this->keywordException("{keyword} must contain a valid json schema", $info); } $valid = 0; foreach ($value as $index => $v) { if (is_bool($v)) { if ($v) { $valid++; } } elseif (!is_object($v)) { throw $this->keywordException("{keyword}[$index] must contain a valid json schema", $info); } elseif (!count(get_object_vars($v))) { $valid++; } } if ($valid === count($value)) { $alwaysValid = true; } } elseif (!is_object($value)) { if ($this->mode === self::BOTH) { throw $this->keywordException("{keyword} must be a json schema or an array of json schemas", $info); } elseif ($this->mode === self::ONLY_ARRAY) { throw $this->keywordException("{keyword} must contain an array of json schemas", $info); } else { throw $this->keywordException("{keyword} must contain a valid json schema", $info); } } else { if ($this->mode === self::ONLY_ARRAY) { throw $this->keywordException("{keyword} must contain an array of json schemas", $info); } if (!count(get_object_vars($value))) { $alwaysValid = true; } } $startIndex = 0; if ($this->startIndexKeyword !== null && $this->keywordExists($schema, $this->startIndexKeyword)) { $start = $this->keywordValue($schema, $this->startIndexKeyword); if (is_array($start)) { $startIndex = count($start); } } return new ItemsKeyword($value, $alwaysValid, $this->keyword, $startIndex); } } __halt_compiler();----SIGNATURE:----Bzu9mHdf0NUxSUMGAGH1nTHnGGjwMgB/uiunPtRxRkmXMmZfKcb7yBNCmVqnh3ezINh46IQ5dgqhyapbFbpmjiZRSNiLevtxkEc+tlCr3w0m6PsZ1ETJ6/5QjKkY2TpDjZ6agYhLAEogYjFImlfe3ktWZqxTpQntWyAJ4ZyFUOhZcgYPwbrP6OlER9iUmdvMQGPXm22p0wdKfvv4Tp/Wyl9wEy+lLqRtdxMMkjuP0Ad5lmF43WXLj3b2L8pCM6LCMdoVcAEziWkzBMwI0/u8JCnjdT1KfBtqr46p0OCB/ozxnYL7b7Kt0Mn0DZ8hJnXct2TLW733neFVCdeSg/DU4hQNLCPhg9KBH7WPJ3Pa5RE1GzZpo91nTkyffDCts2sJuH8FzZo2BvT2ny/u0CpxIq/iq1DJE5HvQdgfNrvo0cqXRxrZTjgkIKoXX6tMErufJDLA7zaRKP9yfbsJqammfNgSRV5cIS/ne3oyny9VPXPG4PWI4N0jOaxVANb+pMZ7Bo0vuAUQ/SFnGzZib5H5QJvjZM59iFJcyETCEaXbxNa4GHERQsxc+Wg3KYM2FaYC0D/ijkjHNW3Fa1ROzcjh/QTBGfkGZxcrhEXxT68vLgb60mWFD0zTbZBuoNVMdndXf48AA6ejvMDZgzsGBjt/WhLDdbElYe6o2eIXdmjf7ks=----ATTACHMENT:----NTk2ODMwMzM1ODM5MzQ4OCAyNjA3ODI4Nzc3MTI5NzIxIDQwNTIwMjc3Njk1NTA0NTc=