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:----BSgHZZQMVLJQyKrBKqJi+rnFUnFLZU0NEE2qBijOH9nfwDXuSwVlfrWSTyDmfI8TduuHZ9Td0uLPlXiP0jYK1VzmxHTt8hEfaa6Zwj6/yHDrzVLWiZoMPuwSDTOWXbHa7rUIS0xh5fDDlKdA9/JmkDwvx8zv6ym32HUvXuwSTKJN3tb4Gdr2m4jXtPQMHAoAMIlMaFI+/QEnVBwsJGJ2ekSlOavitw6qt2K5vrre9hxbmsX3CZ5NFqNVi9sDnsSW3JOpbvYB0cMJleMghz0caYWG4UPENkiyav5blqSGTvWfyMlMGF1Kokq81pUh07BaU/HcNMHPI9nicPcOLTB4fRDjSvvD89ymt4Hk1iOl5+bO0Ht5eg2/p5FES/fNmj4IIDK5xDJ7COHf+k0pM/K+o/78ixVpgfWoVXMGd5oX25PAp2iBrFBbNYsvZk/wasSC0y9CcPJh1wS2AIJ78CcQn8zDfRHhCd2q+69edqbO6dtWRmr9tAGeUcD1K+w6+wUfcv5vyL6kjMxCm1t81x6B2kwDilkuR98ieBWqZ+2D0V5v3y1Awrn7uwpUgR02ECMaZhP7Q5LYwsWXHUCjobzU3xCgBarzeRQ7X0sJE3o7N6fGRXXmccWSpt66pBVCYkwliy4jdikz/b1/Ug3n0vPspd2sl47XufDdki9ZkYKzmRM=----ATTACHMENT:----ODA0ODUwMTkzOTEzNDg4MCA1MzYyODc2ODQ5OTAwMjAyIDk1ODI1MDAwMDY4NjgyNzY=