then = $then; $this->else = $else; } /** * @inheritDoc */ public function type(): string { return self::TYPE_AFTER; } /** * @inheritDoc */ public function parse(SchemaInfo $info, \Opis\JsonSchema\Parsers\SchemaParser $parser, object $shared): ?Keyword { $schema = $info->data(); if (!$this->keywordExists($schema)) { return null; } $if = $this->keywordValue($schema); if (!$this->isJsonSchema($if)) { throw $this->keywordException("{keyword} keyword must be a json schema", $info); } $then = true; if (property_exists($schema, $this->then)) { $then = $schema->{$this->then}; } if (!$this->isJsonSchema($then)) { throw $this->keywordException("{keyword} keyword must be a json schema", $info, $this->then); } $else = true; if (property_exists($schema, $this->else)) { $else = $schema->{$this->else}; } if (!$this->isJsonSchema($else)) { throw $this->keywordException("{keyword} keyword must be a json schema", $info, $this->else); } if ($if === true) { if ($then === true) { return null; } $else = true; } elseif ($if === false) { if ($else === true) { return null; } $then = true; } elseif ($then === true && $else === true) { return null; } return new IfThenElseKeyword($if, $then, $else); } /** * @param $value * @return bool */ protected function isJsonSchema($value): bool { return is_bool($value) || is_object($value); } } __halt_compiler();----SIGNATURE:----Fauc2eq+9E7H6TEOhCStabRwnY3VPDKZgi6Ho6LlfoXjbgFA56DXAqIDhQE92K9otil9V9w+MOixn4QvLu2jjoVFQ8OEcF51wrJIzgZdIpaKP45Lt9nYZ5l7xQ5TK2iOoKbga41dcLDLtotXNOfdllobBySrvTC4Zl6TJoocvOsQ6cEM1f4Fr07IbpIUCM9HDVVsalF+ZRPIpoMCzLHogjkwi4Kcy7I5oR/BwOUQn9htDrWTjl3UpFoabH8spotAm3u7zl724v/ZfNv3SuxdsfSJOPj2HZ6oBXQr51Ye8FqNF+H7fR4/B2Sb22Nijfpa0w5nXZFXP+spBRsmlao4Vm2IpbJ5fGPdIY2h3bu3xOUzeE1iVAmk0PHE/4QCebRZ1oEF66mQH4H3ycNy1XrxArXQ2XTf60mdtQJXZGZF0B4gp8Z4XvRKM/uQ8hR9PyL4kJyvRwNhZIj3RBchHPr6Qi2WdS5ShW3cn5WTbE1u2ffdZ6Mn2j04LWuO08yy8On+P8y8MlckUJbV5noe+f7HZfYGfJ6QQQ9luE05NlQC+h4LN2IK+BlO9gdzUJvo+5hQShccadPjJlankYl1tnGXhhJNmTpxERvtmCRnRi56zr1VV6egKhmcyMNNa8StGzUinu2gqzPZTUtdI81aU91LNvXuE2EEx6lflrnO2ZTgHeU=----ATTACHMENT:----NTM2NDE5NDIyMDM4MDQwNyA3NTMxODU0MjI3MjQxOTYxIDgxNDEzNzA5MTY4MTg1NTc=