Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /* Generated by OutputBooks Team */ class SchemaException extends \Exception ..
Decoded Output download
<?php
/*
Generated by OutputBooks Team
*/
class SchemaException extends \Exception
{
}
class JSON_Schema_Validator
{
protected $schemaDefinition;
protected $schema;
public $errors;
public $par_required = false;
public function __construct($schema)
{
goto JqlCz;
fOyBG:
$this->errors = array();
goto YI1HF;
JqlCz:
$this->schema = $schema;
goto fOyBG;
Zl9Yr:
throw new SchemaException("Unable to parse JSON data - syntax error ?");
goto UE7T2;
YI1HF:
if (!($this->schema === null)) {
goto NT2uz;
}
goto Zl9Yr;
UE7T2:
NT2uz:
goto X7sF3;
X7sF3:
}
public function validate($entity, $entityName = null)
{
goto FHaSc;
oqkOD:
return $this;
goto sBR5L;
x02WT:
$this->validateType($entity, $this->schema, $entityName);
goto oqkOD;
FHaSc:
$entityName = $entityName ?: "root";
goto x02WT;
sBR5L:
}
public function checkFormat($entity, $schema, $entityName)
{
goto L5AiN;
QylpI:
if ($valid) {
goto dPl1s;
}
goto RTYiG;
s1Dr7:
wT532:
goto PUwqC;
eV_Io:
return $this;
goto s1Dr7;
b1VzT:
VwIb9:
goto NY5r0;
WbobS:
switch ($schema->format) {
case "date-time":
goto Yx0IM;
M16Cj:
goto lp8RG;
goto oXj_5;
VGtRS:
C_Od4:
goto M16Cj;
qAHvJ:
$valid = false;
goto VGtRS;
Yx0IM:
if (preg_match("#^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$#", $entity)) {
goto C_Od4;
}
goto qAHvJ;
oXj_5:
case "date":
goto QePKq;
PZpcv:
$valid = false;
goto ctl3k;
AwZgD:
goto lp8RG;
goto trUlU;
ctl3k:
UV35L:
goto AwZgD;
QePKq:
if (preg_match("#^\d{4}-\d{2}-\d{2}$#", $entity)) {
goto UV35L;
}
goto PZpcv;
trUlU:
case "time":
goto QP3Ic;
DBnPS:
d8x96:
goto fQwcw;
fQwcw:
goto lp8RG;
goto AjGgo;
QP3Ic:
if (preg_match("#^\d{2}:\d{2}:\d{2}$#", $entity)) {
goto d8x96;
}
goto h6KKP;
h6KKP:
$valid = false;
goto DBnPS;
AjGgo:
case "utc-millisec":
goto SU56D;
cRhD5:
Ql8Tw:
goto u2mRW;
SU56D:
if (!($entity < 0)) {
goto Ql8Tw;
}
goto MYw7X;
u2mRW:
goto lp8RG;
goto w0xS6;
MYw7X:
$valid = false;
goto cRhD5;
w0xS6:
case "color":
goto EyKdr;
jlLKj:
vbeb8:
goto NUfHY;
tpNgp:
goto lp8RG;
goto eFOUA;
YsjH_:
if (!(!preg_match("#^\#[0-9A-F]{6}$#", $entity) && !preg_match("#^\#[0-9A-F]{3}$#", $entity))) {
goto vbeb8;
}
goto M18F3;
EyKdr:
if (in_array($entity, array("maroon", "red", "orange", "yellow", "olive", "green", "purple", "fuchsia", "lime", "teal", "aqua", "blue", "navy", "black", "gray", "silver", "white"))) {
goto ghVR4;
}
goto YsjH_;
NUfHY:
ghVR4:
goto tpNgp;
M18F3:
$valid = false;
goto jlLKj;
eFOUA:
case "style":
goto VSMPr;
IeRhn:
$valid = false;
goto aKYly;
DfSV1:
goto lp8RG;
goto raE6t;
VSMPr:
if (preg_match("#(\.*?)[ ]?:[ ]?(.*?)#", $entity)) {
goto rx_Mf;
}
goto IeRhn;
aKYly:
rx_Mf:
goto DfSV1;
raE6t:
case "phone":
goto BxSYY;
n5l9R:
goto lp8RG;
goto dqFLX;
BxSYY:
if (preg_match("#^[0-9\-+ \(\)]*$#", $entity)) {
goto NB5Ka;
}
goto U_GAp;
y5QHj:
NB5Ka:
goto n5l9R;
U_GAp:
$valid = false;
goto y5QHj;
dqFLX:
case "uri":
goto iLOUg;
rXpEb:
goto lp8RG;
goto RTFvP;
iLOUg:
if (preg_match("#^[A-Za-z0-9:/;,\-_\?&\.%\+\|\#=]*$#", $entity)) {
goto tIAIr;
}
goto GTvX1;
f_aOw:
tIAIr:
goto rXpEb;
GTvX1:
$valid = false;
goto f_aOw;
RTFvP:
}
goto b1VzT;
L5AiN:
if (isset($schema->format)) {
goto wT532;
}
goto eV_Io;
ou85L:
return $this;
goto FZycj;
NY5r0:
lp8RG:
goto QylpI;
PUwqC:
$valid = true;
goto WbobS;
NxwdS:
dPl1s:
goto ou85L;
RTYiG:
$this->errors[] = sprintf("Value for [%s] must match format [%s]", $entityName, $schema->format);
goto NxwdS;
FZycj:
}
protected function validateProperties($entity, $schema, $entityName)
{
goto Hz2H_;
fOtlQ:
WIJ_y:
goto g20Kb;
UUQgQ:
foreach ($schema->properties as $propertyName => $property) {
goto BlbhN;
n74st:
i6jqg:
goto vNlmt;
zOwuQ:
a4sFz:
goto n74st;
LKIpj:
if (!($this->par_required && (!empty($schema->required) && in_array($propertyName, $schema->required) || isset($property->required) && $property->required))) {
goto eM4ua;
}
goto wB_rk;
MTRAi:
goto i6jqg;
goto Ichal;
vNlmt:
tUKFh:
goto KvA5K;
wB_rk:
if (!($propertyName != "BchDtls")) {
goto ahqxm;
}
goto ldj5r;
SB71G:
ahqxm:
goto gGBmr;
AA8u8:
$property->required = $this->par_required ? isset($property->required) ? $property->required : (isset($schema->required) ? $schema->required : null) : null;
goto IyCrK;
A1TE0:
foreach ($entity->{$propertyName} as $key => $val) {
goto O9rQx;
AVGDQ:
$this->validateType($val, $property[0], $path);
goto J0eSw;
J0eSw:
KBJIE:
goto Jlb8H;
O9rQx:
$path = $entityName . "." . $propertyName . "[" . $key . "]";
goto AVGDQ;
Jlb8H:
}
goto DlHgM;
fkzau:
$this->par_required = $entityName == "root" ? in_array($propertyName, $schema->properties->required) : $this->par_required;
goto t2i1H;
rsBIx:
goto a4sFz;
goto i2kQn;
i2kQn:
p0NU2:
goto A1TE0;
t2i1H:
if (is_array($property)) {
goto p0NU2;
}
goto Tfpmb;
ldj5r:
$this->errors[] = sprintf("Missing required property [%s] for [%s]", $propertyName, $entityName);
goto SB71G;
Ichal:
Cx9ig:
goto fkzau;
JXB9V:
if (array_key_exists($propertyName, $properties)) {
goto Cx9ig;
}
goto LKIpj;
BlbhN:
$this->par_required = $entityName == "root" ? in_array($propertyName, $schema->properties->required) : $this->par_required;
goto JXB9V;
DlHgM:
SxycW:
goto zOwuQ;
IyCrK:
$this->validateType($entity->{$propertyName}, $property, $path);
goto rsBIx;
gGBmr:
eM4ua:
goto MTRAi;
Tfpmb:
$path = $entityName . "." . $propertyName;
goto AA8u8;
KvA5K:
}
goto Db2TK;
bcRDc:
$this->errors[] = sprintf("Additional properties [%s] not allowed for property [%s]", implode(",", $extra), $entityName);
goto fOtlQ;
g20Kb:
QUIcW:
goto c0AqV;
Db2TK:
tgurl:
goto pv028;
OwQ6I:
BI3mO:
goto UUQgQ;
e7UM_:
$extra = array_diff(array_keys((array) $entity), array_keys((array) $schema->properties));
goto FwbHU;
Pybcp:
return $this;
goto OwQ6I;
FwbHU:
if (!count($extra)) {
goto WIJ_y;
}
goto bcRDc;
c0AqV:
return $this;
goto pNJqS;
qmAhe:
if (isset($schema->properties)) {
goto BI3mO;
}
goto Pybcp;
pv028:
if (!(isset($schema->additionalProperties) && !$schema->additionalProperties)) {
goto QUIcW;
}
goto e7UM_;
Hz2H_:
$properties = get_object_vars($entity);
goto qmAhe;
pNJqS:
}
protected function validateType($entity, $schema, $entityName)
{
goto fwiMH;
hld98:
return $this;
goto fiYXO;
wDbI3:
if (is_array($types)) {
goto dr3WR;
}
goto C0U3y;
NjXsO:
return $this;
goto IsErp;
JF40W:
dr3WR:
goto zvpbr;
WBve_:
t_9ZC:
goto wDbI3;
G0lOv:
kGMnP:
goto OGf5r;
fwiMH:
if (!(!$entity && (empty($schema->required) || !in_array(substr($entityName, strrpos($entityName, ".") + 1), $schema->required)))) {
goto cq9PN;
}
goto NjXsO;
gn9jh:
$types = $schema->type;
goto WBve_;
zvpbr:
$valid = false;
goto vWQzM;
ItX35:
if (isset($schema->type)) {
goto fDL_z;
}
goto XEmKj;
vWQzM:
foreach ($types as $type) {
goto qefow;
h4EtX:
j4rAi:
goto pgMhc;
qefow:
switch (strtolower($type)) {
case "object":
goto OXXjH;
PuNSr:
$valid = true;
goto NyD_M;
FzFx3:
$this->checkTypeObject($entity, $schema, $entityName);
goto PuNSr;
NyD_M:
RjTPj:
goto q0FCC;
OXXjH:
if (!is_object($entity)) {
goto RjTPj;
}
goto FzFx3;
q0FCC:
goto j4rAi;
goto FpDzT;
FpDzT:
case "string":
goto Nsq5p;
sngWH:
$valid = true;
goto SwZTZ;
NYsQG:
$this->checkTypeString($entity, $schema, $entityName);
goto sngWH;
Nsq5p:
if (!is_string($entity)) {
goto nYN2z;
}
goto NYsQG;
SwZTZ:
nYN2z:
goto rh7TM;
rh7TM:
goto j4rAi;
goto mCGNp;
mCGNp:
case "array":
goto aXI9N;
LbmTb:
goto j4rAi;
goto g5sTT;
aXI9N:
if (!is_array($entity)) {
goto AWB6M;
}
goto MQUym;
fSJ6l:
AWB6M:
goto LbmTb;
MQUym:
$this->checkTypeArray($entity, $schema, $entityName);
goto BO4cg;
BO4cg:
$valid = true;
goto fSJ6l;
g5sTT:
case "integer":
goto R0vrg;
JYFG0:
oHDI1:
goto Dsh72;
R0vrg:
if (!(!is_string($entity) && is_int($entity))) {
goto oHDI1;
}
goto Bb1DO;
Bb1DO:
$this->checkTypeInteger($entity, $schema, $entityName);
goto p57fV;
Dsh72:
goto j4rAi;
goto gdmcK;
p57fV:
$valid = true;
goto JYFG0;
gdmcK:
case "number":
goto jqPVY;
oYsaM:
FLaDK:
goto QWM6H;
jqPVY:
if (!(!is_string($entity) && is_numeric($entity))) {
goto FLaDK;
}
goto efZNz;
QWM6H:
goto j4rAi;
goto QY2Fz;
efZNz:
$this->checkTypeNumber($entity, $schema, $entityName);
goto rt3D2;
rt3D2:
$valid = true;
goto oYsaM;
QY2Fz:
case "boolean":
goto QCrMz;
Gufmr:
$valid = true;
goto PoNA2;
bbVOa:
goto j4rAi;
goto ZbrUP;
Vl378:
$this->checkTypeBoolean($entity, $schema, $entityName);
goto Gufmr;
QCrMz:
if (!(!is_string($entity) && is_bool($entity))) {
goto GSkIz;
}
goto Vl378;
PoNA2:
GSkIz:
goto bbVOa;
ZbrUP:
case "null":
goto rSVup;
YpDYR:
goto j4rAi;
goto jZfcv;
CIYQL:
$valid = true;
goto OsX4Z;
LnLJm:
$this->checkTypeNull($entity, $schema, $entityName);
goto CIYQL;
rSVup:
if (!is_null($entity)) {
goto wpl3k;
}
goto LnLJm;
OsX4Z:
wpl3k:
goto YpDYR;
jZfcv:
case "any":
goto Knm1G;
Knm1G:
$this->checkTypeAny($entity, $schema, $entityName);
goto Hee6M;
Lzagn:
goto j4rAi;
goto HQqRH;
Hee6M:
$valid = true;
goto Lzagn;
HQqRH:
default:
$valid = true;
goto j4rAi;
}
goto waxnb;
waxnb:
zWdtM:
goto h4EtX;
pgMhc:
J_pWr:
goto iIuSb;
iIuSb:
}
goto G0lOv;
C0U3y:
$types = array($types);
goto JF40W;
XEmKj:
$types = "any";
goto fcucC;
fcucC:
goto t_9ZC;
goto iv5OP;
OGf5r:
if ($valid) {
goto HxdzG;
}
goto ZLvbI;
VYqZ9:
HxdzG:
goto hld98;
iv5OP:
fDL_z:
goto gn9jh;
ZLvbI:
$this->errors[] = sprintf("Property [%s] must be one of the following types: [%s]", $entityName, implode(", ", $types));
goto VYqZ9;
IsErp:
cq9PN:
goto ItX35;
fiYXO:
}
protected function checkTypeObject($entity, $schema, $entityName)
{
$this->validateProperties($entity, $schema, $entityName);
return $this;
}
protected function checkTypeNumber($entity, $schema, $entityName)
{
goto nQ4PW;
hEUJk:
$this->checkDivisibleBy($entity, $schema, $entityName);
goto tDgyN;
nQ4PW:
$this->checkMinimum($entity, $schema, $entityName);
goto nu8UX;
gIhNi:
$this->checkFormat($entity, $schema, $entityName);
goto ITCR1;
I2AsU:
$this->checkDisallow($entity, $schema, $entityName);
goto hEUJk;
IOlC7:
$this->checkExclusiveMinimum($entity, $schema, $entityName);
goto JEHHR;
JEHHR:
$this->checkExclusiveMaximum($entity, $schema, $entityName);
goto gIhNi;
nu8UX:
$this->checkMaximum($entity, $schema, $entityName);
goto IOlC7;
ITCR1:
$this->checkEnum($entity, $schema, $entityName);
goto I2AsU;
tDgyN:
return $this;
goto lRBUx;
lRBUx:
}
protected function checkTypeInteger($entity, $schema, $entityName)
{
goto vo1Ga;
geWtk:
$this->checkExclusiveMaximum($entity, $schema, $entityName);
goto bHi4U;
AojMe:
$this->checkMaximum($entity, $schema, $entityName);
goto PanM0;
vo1Ga:
$this->checkMinimum($entity, $schema, $entityName);
goto AojMe;
pTgHz:
$this->checkEnum($entity, $schema, $entityName);
goto Eciue;
PanM0:
$this->checkExclusiveMinimum($entity, $schema, $entityName);
goto geWtk;
uUdom:
return $this;
goto VMll7;
bHi4U:
$this->checkFormat($entity, $schema, $entityName);
goto pTgHz;
Eciue:
$this->checkDisallow($entity, $schema, $entityName);
goto RhfCD;
RhfCD:
$this->checkDivisibleBy($entity, $schema, $entityName);
goto uUdom;
VMll7:
}
protected function checkTypeBoolean($entity, $schema, $entityName)
{
return $this;
}
protected function checkTypeString($entity, $schema, $entityName)
{
goto SydSA;
SydSA:
$this->checkPattern($entity, $schema, $entityName);
goto uxEjw;
IVU3f:
$this->checkFormat($entity, $schema, $entityName);
goto cSLVV;
cSLVV:
$this->checkEnum($entity, $schema, $entityName);
goto ffAGr;
s12d3:
$this->checkMaxLength($entity, $schema, $entityName);
goto IVU3f;
ffAGr:
$this->checkDisallow($entity, $schema, $entityName);
goto IvPSj;
uxEjw:
$this->checkMinLength($entity, $schema, $entityName);
goto s12d3;
IvPSj:
return $this;
goto nx_Wb;
nx_Wb:
}
protected function checkTypeArray($entity, $schema, $entityName)
{
goto cuFqb;
OFiXJ:
$this->checkUniqueItems($entity, $schema, $entityName);
goto ahJEc;
ahJEc:
$this->checkEnum($entity, $schema, $entityName);
goto KxgW9;
McZAA:
$this->checkDisallow($entity, $schema, $entityName);
goto z3Qcd;
cuFqb:
$this->checkMinItems($entity, $schema, $entityName);
goto oP_Fa;
oP_Fa:
$this->checkMaxItems($entity, $schema, $entityName);
goto OFiXJ;
KxgW9:
$this->checkItems($entity, $schema, $entityName);
goto McZAA;
z3Qcd:
return $this;
goto c3xJo;
c3xJo:
}
protected function checkTypeNull($entity, $schema, $entityName)
{
return $this;
}
protected function checkTypeAny($entity, $schema, $entityName)
{
$this->checkDisallow($entity, $schema, $entityName);
return $this;
}
protected function checkMinimum($entity, $schema, $entityName)
{
goto cdyxB;
EaQ30:
uxyW2:
goto Ddd9W;
onchF:
$this->errors[] = sprintf("Invalid value for [%s], minimum is [%s]", $entityName, $schema->minimum);
goto EaQ30;
Ddd9W:
Gv3C0:
goto RGvUF;
RGvUF:
return $this;
goto KT6VJ;
cdyxB:
if (!isset($schema->minimum)) {
goto Gv3C0;
}
goto oeSj_;
oeSj_:
if (!($entity < $schema->minimum)) {
goto uxyW2;
}
goto onchF;
KT6VJ:
}
protected function checkMaximum($entity, $schema, $entityName)
{
goto n1KF4;
DAs_u:
return $this;
goto x8uIf;
n1KF4:
if (!isset($schema->maximum)) {
goto ZegEB;
}
goto QP5Le;
UBGSn:
ZegEB:
goto DAs_u;
QP5Le:
if (!($entity > $schema->maximum)) {
goto I4EW6;
}
goto KQnoA;
CTjgo:
I4EW6:
goto UBGSn;
KQnoA:
$this->errors[] = sprintf("Invalid value for [%s], maximum is [%s]", $entityName, $schema->maximum);
goto CTjgo;
x8uIf:
}
protected function checkExclusiveMinimum($entity, $schema, $entityName)
{
goto xVxyi;
F0Tib:
dBHML:
goto wfj9m;
wRZPV:
$this->errors[] = sprintf("Invalid value for [%s], must be greater than [%s]", $entityName, $schema->minimum);
goto F0Tib;
Wj6Qs:
return $this;
goto z2hgS;
wfj9m:
G2xZ7:
goto Wj6Qs;
qqETn:
if (!($entity == $schema->minimum)) {
goto dBHML;
}
goto wRZPV;
xVxyi:
if (!(isset($schema->minimum) && isset($schema->exclusiveMinimum) && $schema->exclusiveMinimum)) {
goto G2xZ7;
}
goto qqETn;
z2hgS:
}
protected function checkExclusiveMaximum($entity, $schema, $entityName)
{
goto yhvDG;
BEnKt:
Hd_a1:
goto mUZWN;
eTPyo:
if (!($entity == $schema->maximum)) {
goto PcN0H;
}
goto dtqmH;
mUZWN:
return $this;
goto oz4K2;
dtqmH:
$this->errors[] = sprintf("Invalid value for [%s], must be less than [%s]", $entityName, $schema->maximum);
goto aVj8k;
aVj8k:
PcN0H:
goto BEnKt;
yhvDG:
if (!(isset($schema->maximum) && isset($schema->exclusiveMaximum) && $schema->exclusiveMaximum)) {
goto Hd_a1;
}
goto eTPyo;
oz4K2:
}
protected function checkPattern($entity, $schema, $entityName)
{
goto SpOog;
FaQBA:
NOeny:
goto I30y2;
SpOog:
if (!(isset($schema->pattern) && $schema->pattern)) {
goto NOeny;
}
goto FaQBA;
I30y2:
return $this;
goto UfAsU;
UfAsU:
}
protected function checkMinLength($entity, $schema, $entityName)
{
goto PuKzs;
kQapK:
xyOkK:
goto LqPK8;
ncMeM:
$this->errors[] = sprintf("String too short for [%s], minimum length is [%s]", $entityName, $schema->minLength);
goto V54VV;
PuKzs:
if (!(isset($schema->minLength) && $schema->minLength)) {
goto xyOkK;
}
goto yELqF;
LqPK8:
return $this;
goto sERNS;
yELqF:
if (!(strlen($entity) < $schema->minLength)) {
goto ABh36;
}
goto ncMeM;
V54VV:
ABh36:
goto kQapK;
sERNS:
}
protected function checkMaxLength($entity, $schema, $entityName)
{
goto giEdG;
Xeg4A:
if (!(strlen($entity) > $schema->maxLength)) {
goto Zjguk;
}
goto MSKF0;
MSKF0:
$this->errors[] = sprintf("String too long for [%s], maximum length is [%s]", $entityName, $schema->maxLength);
goto OMLCZ;
giEdG:
if (!(isset($schema->maxLength) && $schema->maxLength)) {
goto fcklk;
}
goto Xeg4A;
OMLCZ:
Zjguk:
goto KF6mY;
W2l3T:
return $this;
goto YpSkr;
KF6mY:
fcklk:
goto W2l3T;
YpSkr:
}
protected function checkMinItems($entity, $schema, $entityName)
{
goto u_SoX;
nAoBi:
HfwA0:
goto DccYt;
QuAjv:
$this->errors[] = sprintf("Not enough array items for [%s], minimum is [%s]", $entityName, $schema->minItems);
goto nAoBi;
qfP50:
return $this;
goto axA_T;
DccYt:
Ze0U3:
goto qfP50;
u_SoX:
if (!(isset($schema->minItems) && $schema->minItems)) {
goto Ze0U3;
}
goto uX9hB;
uX9hB:
if (!(count($entity) < $schema->minItems)) {
goto HfwA0;
}
goto QuAjv;
axA_T:
}
protected function checkMaxItems($entity, $schema, $entityName)
{
goto tDK2w;
l7qwp:
if (!(count($entity) > $schema->maxItems)) {
goto lwr3L;
}
goto P6QcZ;
hrQ2k:
lwr3L:
goto xHA1e;
P6QcZ:
$this->errors[] = sprintf("Too many array items for [%s], maximum is [%s]", $entityName, $schema->maxItems);
goto hrQ2k;
gf81t:
return $this;
goto SFJeW;
xHA1e:
P95wR:
goto gf81t;
tDK2w:
if (!(isset($schema->maxItems) && $schema->maxItems)) {
goto P95wR;
}
goto l7qwp;
SFJeW:
}
protected function checkUniqueItems($entity, $schema, $entityName)
{
goto XuwUQ;
tnfms:
qFOhW:
goto n6MDY;
ne1_J:
if (!(count(array_unique($entity)) != count($entity))) {
goto Zwqd0;
}
goto vG9Et;
XuwUQ:
if (!(isset($schema->uniqueItems) && $schema->uniqueItems)) {
goto qFOhW;
}
goto ne1_J;
wjNtp:
Zwqd0:
goto tnfms;
n6MDY:
return $this;
goto BZvxN;
vG9Et:
$this->errors[] = sprintf("All items in array [%s] must be unique", $entityName);
goto wjNtp;
BZvxN:
}
protected function checkEnum($entity, $schema, $entityName)
{
goto xgOAZ;
np5o9:
if (!(isset($schema->enum) && $schema->enum)) {
goto lsTUO;
}
goto jTd0f;
g7C_T:
lsTUO:
goto hfwbs;
wcrI9:
$valid = false;
goto lcJ28;
BwoB3:
throw new SchemaException(sprintf("Enum property must be an array for [%s]", $entityName));
goto F1dFk;
s1eON:
foreach ($entity as $val) {
goto Zmg0S;
zm_5x:
$valid = false;
goto MrKw1;
iqO5d:
lKLTP:
goto G8kiK;
Zmg0S:
if (in_array($val, $schema->enum)) {
goto wWjf2;
}
goto zm_5x;
MrKw1:
wWjf2:
goto iqO5d;
G8kiK:
}
goto b_y4I;
b_y4I:
xCL3H:
goto cOer7;
jTd0f:
if (is_array($schema->enum)) {
goto ICvZD;
}
goto BwoB3;
UGpxR:
if (is_array($entity)) {
goto bdzrf;
}
goto dbJ4b;
nSuYZ:
jponr:
goto Q0Ye_;
F1dFk:
ICvZD:
goto UGpxR;
cOer7:
YeH1T:
goto g7C_T;
Sk3UN:
goto YeH1T;
goto ExkQ0;
lcJ28:
BK7r6:
goto Sk3UN;
hfwbs:
if ($valid) {
goto jponr;
}
goto uN4k2;
ExkQ0:
bdzrf:
goto s1eON;
dbJ4b:
if (in_array($entity, $schema->enum)) {
goto BK7r6;
}
goto wcrI9;
xgOAZ:
$valid = true;
goto np5o9;
Q0Ye_:
return $this;
goto I_Gie;
uN4k2:
$this->errors[] = sprintf("Invalid value(s) for [%s], allowable values are [%s], But [%s] given", $entityName, implode(",", $schema->enum), $entity);
goto nSuYZ;
I_Gie:
}
protected function checkItems($entity, $schema, $entityName)
{
goto did4f;
tmjcd:
goto aU4Qo;
goto U0Gkd;
Rt8nX:
GsRNi:
goto tmjcd;
A8iEs:
if (is_object($schema->items)) {
goto KtqVq;
}
goto RkmdW;
s6xL3:
HIPDu:
goto dwLrH;
dwLrH:
aU4Qo:
goto AcQ18;
QCW0J:
goto GsRNi;
goto x9rGd;
U0Gkd:
Iuotr:
goto wZn2U;
l6fqj:
if (is_array($schema->items)) {
goto Iuotr;
}
goto A8iEs;
lRxAa:
return $this;
goto Sb5fY;
oqCMy:
mYfTP:
goto Rt8nX;
RkmdW:
throw new SchemaException(sprintf("Invalid items value for [%s]", $entityName));
goto QCW0J;
rXzz8:
foreach ($entity as $index => $node) {
goto Yp5L1;
TpL3N:
bI_Ar:
goto OGWir;
bheKm:
$this->validateType($node, $schema->items, $nodeEntityName);
goto TpL3N;
Yp5L1:
$nodeEntityName = $entityName . "[" . $index . "]";
goto bheKm;
OGWir:
}
goto oqCMy;
did4f:
if (!(isset($schema->items) && $schema->items)) {
goto wmhdy;
}
goto l6fqj;
wZn2U:
foreach ($entity as $index => $node) {
goto zPUrd;
zPUrd:
$nodeEntityName = $entityName . "[" . $index . "]";
goto fFcie;
DxTZh:
if ($nodeValid) {
goto nTZZ7;
}
goto Cng4w;
fFcie:
foreach ($schema->items as $item) {
goto DT1lr;
ymW9f:
if (!$nodeValid) {
goto mJNoS;
}
goto TwcW7;
erTqX:
mJNoS:
goto BI5Ui;
DT1lr:
$this->validateType($node, $item, $nodeEntityName);
goto Fzhi8;
TwcW7:
goto B00g3;
goto erTqX;
Fzhi8:
$nodeValid = count($this->errors) > 0 ? false : true;
goto ymW9f;
BI5Ui:
rWd_M:
goto JrJC4;
JrJC4:
}
goto Wb_oJ;
t7fNZ:
$this->errors[] = sprintf("Invalid value for [%s], must be one of the following types: [%s]", $nodeEntityName, implode(", ", $allowedTypes));
goto sqJq_;
Wb_oJ:
B00g3:
goto DxTZh;
sqJq_:
nTZZ7:
goto a66nc;
a66nc:
d6Jrs:
goto RieN4;
Cng4w:
$allowedTypes = array_map(function ($item) {
return $item->type == "object" ? "object (schema)" : $item->type;
}, $schema->items);
goto t7fNZ;
RieN4:
}
goto s6xL3;
x9rGd:
KtqVq:
goto rXzz8;
AcQ18:
wmhdy:
goto lRxAa;
Sb5fY:
}
protected function checkDisallow($entity, $schema, $entityName)
{
goto emJxu;
K5XGm:
if ($valid) {
goto dhWd8;
}
goto ZtTuu;
GQM8b:
$this->validateType($entity, $thisSchema, $entityName);
goto TsmWg;
bNGAb:
yIpws:
goto MXvUJ;
JzWqq:
$thisSchema->type = $schema->disallow;
goto UtQB_;
UtQB_:
unset($thisSchema->disallow);
goto GQM8b;
emJxu:
if (!(isset($schema->disallow) && $schema->disallow)) {
goto yIpws;
}
goto VhI11;
G1N6S:
dhWd8:
goto bNGAb;
ZtTuu:
$disallowedTypes = array_map(function ($item) {
return is_object($item) ? "object (schema)" : $item;
}, is_array($schema->disallow) ? $schema->disallow : array($schema->disallow));
goto ReqhU;
VhI11:
$thisSchema = clone $schema;
goto JzWqq;
MXvUJ:
return $this;
goto cpIcV;
TsmWg:
$valid = count($this->errors) > 0 ? true : false;
goto K5XGm;
ReqhU:
$this->errors[] = sprintf("Invalid value for [%s], disallowed types are [%s]", $entityName, implode(", ", $disallowedTypes));
goto G1N6S;
cpIcV:
}
protected function checkDivisibleBy($entity, $schema, $entityName)
{
goto vaS1J;
vaS1J:
if (!(isset($schema->divisibleBy) && $schema->divisibleBy)) {
goto yWQUd;
}
goto rB9Jf;
L7dUF:
yWQUd:
goto yrTSR;
ObAXN:
l9OUm:
goto L7dUF;
xKE2b:
$this->errors[] = sprintf("Invalid value for [%s], must be divisible by [%d]", $entityName, $schema->divisibleBy);
goto ObAXN;
owr2K:
dvcEB:
goto y5CJq;
y5CJq:
if (!($entity % $schema->divisibleBy != 0)) {
goto l9OUm;
}
goto xKE2b;
rB9Jf:
if (is_numeric($schema->divisibleBy)) {
goto dvcEB;
}
goto rkxaZ;
yrTSR:
return $this;
goto fGThj;
rkxaZ:
throw new SchemaException(sprintf("Invalid divisibleBy value for [%s], must be numeric", $entityName));
goto owr2K;
fGThj:
}
}
?>
Did this file decode correctly?
Original Code
<?php
/*
Generated by OutputBooks Team
*/
class SchemaException extends \Exception
{
}
class JSON_Schema_Validator
{
protected $schemaDefinition;
protected $schema;
public $errors;
public $par_required = false;
public function __construct($schema)
{
goto JqlCz;
fOyBG:
$this->errors = array();
goto YI1HF;
JqlCz:
$this->schema = $schema;
goto fOyBG;
Zl9Yr:
throw new SchemaException("\x55\x6e\141\142\x6c\145\40\164\157\x20\x70\x61\162\163\145\x20\112\x53\117\x4e\40\144\x61\164\x61\x20\55\x20\x73\171\x6e\x74\x61\x78\x20\145\162\162\x6f\162\40\x3f");
goto UE7T2;
YI1HF:
if (!($this->schema === null)) {
goto NT2uz;
}
goto Zl9Yr;
UE7T2:
NT2uz:
goto X7sF3;
X7sF3:
}
public function validate($entity, $entityName = null)
{
goto FHaSc;
oqkOD:
return $this;
goto sBR5L;
x02WT:
$this->validateType($entity, $this->schema, $entityName);
goto oqkOD;
FHaSc:
$entityName = $entityName ?: "\162\157\x6f\x74";
goto x02WT;
sBR5L:
}
public function checkFormat($entity, $schema, $entityName)
{
goto L5AiN;
QylpI:
if ($valid) {
goto dPl1s;
}
goto RTYiG;
s1Dr7:
wT532:
goto PUwqC;
eV_Io:
return $this;
goto s1Dr7;
b1VzT:
VwIb9:
goto NY5r0;
WbobS:
switch ($schema->format) {
case "\x64\x61\164\145\x2d\164\151\155\x65":
goto Yx0IM;
M16Cj:
goto lp8RG;
goto oXj_5;
VGtRS:
C_Od4:
goto M16Cj;
qAHvJ:
$valid = false;
goto VGtRS;
Yx0IM:
if (preg_match("\43\136\134\144\173\64\175\x2d\134\x64\173\x32\175\x2d\x5c\x64\173\62\x7d\124\134\144\173\62\175\72\134\144\173\x32\175\72\134\144\x7b\x32\175\132\x24\x23", $entity)) {
goto C_Od4;
}
goto qAHvJ;
oXj_5:
case "\x64\x61\164\145":
goto QePKq;
PZpcv:
$valid = false;
goto ctl3k;
AwZgD:
goto lp8RG;
goto trUlU;
ctl3k:
UV35L:
goto AwZgD;
QePKq:
if (preg_match("\43\136\134\144\173\64\175\x2d\134\x64\x7b\62\175\55\x5c\x64\173\62\175\44\x23", $entity)) {
goto UV35L;
}
goto PZpcv;
trUlU:
case "\164\x69\155\145":
goto QP3Ic;
DBnPS:
d8x96:
goto fQwcw;
fQwcw:
goto lp8RG;
goto AjGgo;
QP3Ic:
if (preg_match("\43\x5e\x5c\x64\x7b\62\175\x3a\x5c\144\x7b\x32\x7d\72\x5c\x64\x7b\62\175\44\x23", $entity)) {
goto d8x96;
}
goto h6KKP;
h6KKP:
$valid = false;
goto DBnPS;
AjGgo:
case "\165\x74\x63\x2d\x6d\151\x6c\154\x69\x73\x65\x63":
goto SU56D;
cRhD5:
Ql8Tw:
goto u2mRW;
SU56D:
if (!($entity < 0)) {
goto Ql8Tw;
}
goto MYw7X;
u2mRW:
goto lp8RG;
goto w0xS6;
MYw7X:
$valid = false;
goto cRhD5;
w0xS6:
case "\x63\x6f\154\x6f\162":
goto EyKdr;
jlLKj:
vbeb8:
goto NUfHY;
tpNgp:
goto lp8RG;
goto eFOUA;
YsjH_:
if (!(!preg_match("\43\x5e\x5c\43\133\x30\55\x39\101\x2d\106\135\x7b\66\x7d\44\43", $entity) && !preg_match("\43\136\x5c\43\x5b\60\x2d\x39\x41\x2d\x46\x5d\x7b\63\175\x24\43", $entity))) {
goto vbeb8;
}
goto M18F3;
EyKdr:
if (in_array($entity, array("\155\141\x72\x6f\x6f\x6e", "\x72\x65\x64", "\157\x72\x61\x6e\147\x65", "\171\x65\x6c\154\157\x77", "\x6f\154\x69\x76\145", "\x67\x72\x65\x65\156", "\160\165\x72\160\154\145", "\x66\x75\x63\150\x73\x69\x61", "\x6c\x69\x6d\145", "\x74\x65\x61\154", "\x61\x71\165\x61", "\x62\154\165\x65", "\156\x61\166\171", "\142\154\x61\x63\x6b", "\147\x72\x61\171", "\x73\x69\154\166\x65\x72", "\x77\x68\x69\164\145"))) {
goto ghVR4;
}
goto YsjH_;
NUfHY:
ghVR4:
goto tpNgp;
M18F3:
$valid = false;
goto jlLKj;
eFOUA:
case "\163\x74\x79\x6c\145":
goto VSMPr;
IeRhn:
$valid = false;
goto aKYly;
DfSV1:
goto lp8RG;
goto raE6t;
VSMPr:
if (preg_match("\x23\x28\x5c\x2e\52\77\51\x5b\40\135\x3f\72\133\40\x5d\x3f\50\56\52\77\51\x23", $entity)) {
goto rx_Mf;
}
goto IeRhn;
aKYly:
rx_Mf:
goto DfSV1;
raE6t:
case "\x70\x68\x6f\x6e\145":
goto BxSYY;
n5l9R:
goto lp8RG;
goto dqFLX;
BxSYY:
if (preg_match("\x23\x5e\133\60\55\71\134\x2d\x2b\x20\134\50\x5c\51\x5d\52\x24\43", $entity)) {
goto NB5Ka;
}
goto U_GAp;
y5QHj:
NB5Ka:
goto n5l9R;
U_GAp:
$valid = false;
goto y5QHj;
dqFLX:
case "\x75\162\x69":
goto iLOUg;
rXpEb:
goto lp8RG;
goto RTFvP;
iLOUg:
if (preg_match("\43\x5e\133\x41\x2d\x5a\x61\55\x7a\60\55\71\72\57\x3b\54\134\55\137\134\77\x26\x5c\56\x25\x5c\x2b\134\174\x5c\43\x3d\135\x2a\44\43", $entity)) {
goto tIAIr;
}
goto GTvX1;
f_aOw:
tIAIr:
goto rXpEb;
GTvX1:
$valid = false;
goto f_aOw;
RTFvP:
}
goto b1VzT;
L5AiN:
if (isset($schema->format)) {
goto wT532;
}
goto eV_Io;
ou85L:
return $this;
goto FZycj;
NY5r0:
lp8RG:
goto QylpI;
PUwqC:
$valid = true;
goto WbobS;
NxwdS:
dPl1s:
goto ou85L;
RTYiG:
$this->errors[] = sprintf("\x56\x61\x6c\x75\145\40\146\x6f\162\x20\x5b\45\163\x5d\40\155\165\x73\164\x20\155\141\x74\x63\x68\40\x66\157\162\x6d\141\x74\x20\x5b\45\163\x5d", $entityName, $schema->format);
goto NxwdS;
FZycj:
}
protected function validateProperties($entity, $schema, $entityName)
{
goto Hz2H_;
fOtlQ:
WIJ_y:
goto g20Kb;
UUQgQ:
foreach ($schema->properties as $propertyName => $property) {
goto BlbhN;
n74st:
i6jqg:
goto vNlmt;
zOwuQ:
a4sFz:
goto n74st;
LKIpj:
if (!($this->par_required && (!empty($schema->required) && in_array($propertyName, $schema->required) || isset($property->required) && $property->required))) {
goto eM4ua;
}
goto wB_rk;
MTRAi:
goto i6jqg;
goto Ichal;
vNlmt:
tUKFh:
goto KvA5K;
wB_rk:
if (!($propertyName != "\102\143\150\x44\x74\154\x73")) {
goto ahqxm;
}
goto ldj5r;
SB71G:
ahqxm:
goto gGBmr;
AA8u8:
$property->required = $this->par_required ? isset($property->required) ? $property->required : (isset($schema->required) ? $schema->required : null) : null;
goto IyCrK;
A1TE0:
foreach ($entity->{$propertyName} as $key => $val) {
goto O9rQx;
AVGDQ:
$this->validateType($val, $property[0], $path);
goto J0eSw;
J0eSw:
KBJIE:
goto Jlb8H;
O9rQx:
$path = $entityName . "\56" . $propertyName . "\x5b" . $key . "\x5d";
goto AVGDQ;
Jlb8H:
}
goto DlHgM;
fkzau:
$this->par_required = $entityName == "\x72\157\x6f\164" ? in_array($propertyName, $schema->properties->required) : $this->par_required;
goto t2i1H;
rsBIx:
goto a4sFz;
goto i2kQn;
i2kQn:
p0NU2:
goto A1TE0;
t2i1H:
if (is_array($property)) {
goto p0NU2;
}
goto Tfpmb;
ldj5r:
$this->errors[] = sprintf("\115\x69\163\163\151\156\147\x20\x72\x65\161\x75\x69\162\x65\144\x20\160\162\x6f\160\x65\162\x74\x79\x20\x5b\x25\163\135\x20\146\157\162\40\x5b\45\163\135", $propertyName, $entityName);
goto SB71G;
Ichal:
Cx9ig:
goto fkzau;
JXB9V:
if (array_key_exists($propertyName, $properties)) {
goto Cx9ig;
}
goto LKIpj;
BlbhN:
$this->par_required = $entityName == "\x72\x6f\x6f\164" ? in_array($propertyName, $schema->properties->required) : $this->par_required;
goto JXB9V;
DlHgM:
SxycW:
goto zOwuQ;
IyCrK:
$this->validateType($entity->{$propertyName}, $property, $path);
goto rsBIx;
gGBmr:
eM4ua:
goto MTRAi;
Tfpmb:
$path = $entityName . "\x2e" . $propertyName;
goto AA8u8;
KvA5K:
}
goto Db2TK;
bcRDc:
$this->errors[] = sprintf("\x41\x64\144\151\164\151\157\x6e\141\x6c\40\160\x72\x6f\160\x65\162\164\x69\x65\163\40\133\45\163\x5d\40\x6e\157\164\x20\141\154\x6c\157\167\145\x64\x20\146\x6f\162\40\160\162\x6f\160\145\x72\x74\x79\40\x5b\x25\163\x5d", implode("\54", $extra), $entityName);
goto fOtlQ;
g20Kb:
QUIcW:
goto c0AqV;
Db2TK:
tgurl:
goto pv028;
OwQ6I:
BI3mO:
goto UUQgQ;
e7UM_:
$extra = array_diff(array_keys((array) $entity), array_keys((array) $schema->properties));
goto FwbHU;
Pybcp:
return $this;
goto OwQ6I;
FwbHU:
if (!count($extra)) {
goto WIJ_y;
}
goto bcRDc;
c0AqV:
return $this;
goto pNJqS;
qmAhe:
if (isset($schema->properties)) {
goto BI3mO;
}
goto Pybcp;
pv028:
if (!(isset($schema->additionalProperties) && !$schema->additionalProperties)) {
goto QUIcW;
}
goto e7UM_;
Hz2H_:
$properties = get_object_vars($entity);
goto qmAhe;
pNJqS:
}
protected function validateType($entity, $schema, $entityName)
{
goto fwiMH;
hld98:
return $this;
goto fiYXO;
wDbI3:
if (is_array($types)) {
goto dr3WR;
}
goto C0U3y;
NjXsO:
return $this;
goto IsErp;
JF40W:
dr3WR:
goto zvpbr;
WBve_:
t_9ZC:
goto wDbI3;
G0lOv:
kGMnP:
goto OGf5r;
fwiMH:
if (!(!$entity && (empty($schema->required) || !in_array(substr($entityName, strrpos($entityName, "\56") + 1), $schema->required)))) {
goto cq9PN;
}
goto NjXsO;
gn9jh:
$types = $schema->type;
goto WBve_;
zvpbr:
$valid = false;
goto vWQzM;
ItX35:
if (isset($schema->type)) {
goto fDL_z;
}
goto XEmKj;
vWQzM:
foreach ($types as $type) {
goto qefow;
h4EtX:
j4rAi:
goto pgMhc;
qefow:
switch (strtolower($type)) {
case "\x6f\x62\152\145\143\164":
goto OXXjH;
PuNSr:
$valid = true;
goto NyD_M;
FzFx3:
$this->checkTypeObject($entity, $schema, $entityName);
goto PuNSr;
NyD_M:
RjTPj:
goto q0FCC;
OXXjH:
if (!is_object($entity)) {
goto RjTPj;
}
goto FzFx3;
q0FCC:
goto j4rAi;
goto FpDzT;
FpDzT:
case "\x73\x74\x72\151\x6e\x67":
goto Nsq5p;
sngWH:
$valid = true;
goto SwZTZ;
NYsQG:
$this->checkTypeString($entity, $schema, $entityName);
goto sngWH;
Nsq5p:
if (!is_string($entity)) {
goto nYN2z;
}
goto NYsQG;
SwZTZ:
nYN2z:
goto rh7TM;
rh7TM:
goto j4rAi;
goto mCGNp;
mCGNp:
case "\141\162\x72\x61\x79":
goto aXI9N;
LbmTb:
goto j4rAi;
goto g5sTT;
aXI9N:
if (!is_array($entity)) {
goto AWB6M;
}
goto MQUym;
fSJ6l:
AWB6M:
goto LbmTb;
MQUym:
$this->checkTypeArray($entity, $schema, $entityName);
goto BO4cg;
BO4cg:
$valid = true;
goto fSJ6l;
g5sTT:
case "\x69\x6e\164\x65\x67\x65\x72":
goto R0vrg;
JYFG0:
oHDI1:
goto Dsh72;
R0vrg:
if (!(!is_string($entity) && is_int($entity))) {
goto oHDI1;
}
goto Bb1DO;
Bb1DO:
$this->checkTypeInteger($entity, $schema, $entityName);
goto p57fV;
Dsh72:
goto j4rAi;
goto gdmcK;
p57fV:
$valid = true;
goto JYFG0;
gdmcK:
case "\156\x75\x6d\x62\x65\x72":
goto jqPVY;
oYsaM:
FLaDK:
goto QWM6H;
jqPVY:
if (!(!is_string($entity) && is_numeric($entity))) {
goto FLaDK;
}
goto efZNz;
QWM6H:
goto j4rAi;
goto QY2Fz;
efZNz:
$this->checkTypeNumber($entity, $schema, $entityName);
goto rt3D2;
rt3D2:
$valid = true;
goto oYsaM;
QY2Fz:
case "\142\157\157\x6c\x65\x61\156":
goto QCrMz;
Gufmr:
$valid = true;
goto PoNA2;
bbVOa:
goto j4rAi;
goto ZbrUP;
Vl378:
$this->checkTypeBoolean($entity, $schema, $entityName);
goto Gufmr;
QCrMz:
if (!(!is_string($entity) && is_bool($entity))) {
goto GSkIz;
}
goto Vl378;
PoNA2:
GSkIz:
goto bbVOa;
ZbrUP:
case "\x6e\x75\x6c\x6c":
goto rSVup;
YpDYR:
goto j4rAi;
goto jZfcv;
CIYQL:
$valid = true;
goto OsX4Z;
LnLJm:
$this->checkTypeNull($entity, $schema, $entityName);
goto CIYQL;
rSVup:
if (!is_null($entity)) {
goto wpl3k;
}
goto LnLJm;
OsX4Z:
wpl3k:
goto YpDYR;
jZfcv:
case "\x61\156\x79":
goto Knm1G;
Knm1G:
$this->checkTypeAny($entity, $schema, $entityName);
goto Hee6M;
Lzagn:
goto j4rAi;
goto HQqRH;
Hee6M:
$valid = true;
goto Lzagn;
HQqRH:
default:
$valid = true;
goto j4rAi;
}
goto waxnb;
waxnb:
zWdtM:
goto h4EtX;
pgMhc:
J_pWr:
goto iIuSb;
iIuSb:
}
goto G0lOv;
C0U3y:
$types = array($types);
goto JF40W;
XEmKj:
$types = "\x61\156\x79";
goto fcucC;
fcucC:
goto t_9ZC;
goto iv5OP;
OGf5r:
if ($valid) {
goto HxdzG;
}
goto ZLvbI;
VYqZ9:
HxdzG:
goto hld98;
iv5OP:
fDL_z:
goto gn9jh;
ZLvbI:
$this->errors[] = sprintf("\120\x72\157\x70\145\x72\164\171\x20\x5b\45\163\x5d\40\x6d\165\163\x74\x20\x62\x65\40\x6f\x6e\x65\x20\157\146\40\164\x68\145\40\146\x6f\x6c\154\157\x77\x69\x6e\147\x20\x74\171\160\145\163\x3a\40\x5b\45\163\135", $entityName, implode("\54\x20", $types));
goto VYqZ9;
IsErp:
cq9PN:
goto ItX35;
fiYXO:
}
protected function checkTypeObject($entity, $schema, $entityName)
{
$this->validateProperties($entity, $schema, $entityName);
return $this;
}
protected function checkTypeNumber($entity, $schema, $entityName)
{
goto nQ4PW;
hEUJk:
$this->checkDivisibleBy($entity, $schema, $entityName);
goto tDgyN;
nQ4PW:
$this->checkMinimum($entity, $schema, $entityName);
goto nu8UX;
gIhNi:
$this->checkFormat($entity, $schema, $entityName);
goto ITCR1;
I2AsU:
$this->checkDisallow($entity, $schema, $entityName);
goto hEUJk;
IOlC7:
$this->checkExclusiveMinimum($entity, $schema, $entityName);
goto JEHHR;
JEHHR:
$this->checkExclusiveMaximum($entity, $schema, $entityName);
goto gIhNi;
nu8UX:
$this->checkMaximum($entity, $schema, $entityName);
goto IOlC7;
ITCR1:
$this->checkEnum($entity, $schema, $entityName);
goto I2AsU;
tDgyN:
return $this;
goto lRBUx;
lRBUx:
}
protected function checkTypeInteger($entity, $schema, $entityName)
{
goto vo1Ga;
geWtk:
$this->checkExclusiveMaximum($entity, $schema, $entityName);
goto bHi4U;
AojMe:
$this->checkMaximum($entity, $schema, $entityName);
goto PanM0;
vo1Ga:
$this->checkMinimum($entity, $schema, $entityName);
goto AojMe;
pTgHz:
$this->checkEnum($entity, $schema, $entityName);
goto Eciue;
PanM0:
$this->checkExclusiveMinimum($entity, $schema, $entityName);
goto geWtk;
uUdom:
return $this;
goto VMll7;
bHi4U:
$this->checkFormat($entity, $schema, $entityName);
goto pTgHz;
Eciue:
$this->checkDisallow($entity, $schema, $entityName);
goto RhfCD;
RhfCD:
$this->checkDivisibleBy($entity, $schema, $entityName);
goto uUdom;
VMll7:
}
protected function checkTypeBoolean($entity, $schema, $entityName)
{
return $this;
}
protected function checkTypeString($entity, $schema, $entityName)
{
goto SydSA;
SydSA:
$this->checkPattern($entity, $schema, $entityName);
goto uxEjw;
IVU3f:
$this->checkFormat($entity, $schema, $entityName);
goto cSLVV;
cSLVV:
$this->checkEnum($entity, $schema, $entityName);
goto ffAGr;
s12d3:
$this->checkMaxLength($entity, $schema, $entityName);
goto IVU3f;
ffAGr:
$this->checkDisallow($entity, $schema, $entityName);
goto IvPSj;
uxEjw:
$this->checkMinLength($entity, $schema, $entityName);
goto s12d3;
IvPSj:
return $this;
goto nx_Wb;
nx_Wb:
}
protected function checkTypeArray($entity, $schema, $entityName)
{
goto cuFqb;
OFiXJ:
$this->checkUniqueItems($entity, $schema, $entityName);
goto ahJEc;
ahJEc:
$this->checkEnum($entity, $schema, $entityName);
goto KxgW9;
McZAA:
$this->checkDisallow($entity, $schema, $entityName);
goto z3Qcd;
cuFqb:
$this->checkMinItems($entity, $schema, $entityName);
goto oP_Fa;
oP_Fa:
$this->checkMaxItems($entity, $schema, $entityName);
goto OFiXJ;
KxgW9:
$this->checkItems($entity, $schema, $entityName);
goto McZAA;
z3Qcd:
return $this;
goto c3xJo;
c3xJo:
}
protected function checkTypeNull($entity, $schema, $entityName)
{
return $this;
}
protected function checkTypeAny($entity, $schema, $entityName)
{
$this->checkDisallow($entity, $schema, $entityName);
return $this;
}
protected function checkMinimum($entity, $schema, $entityName)
{
goto cdyxB;
EaQ30:
uxyW2:
goto Ddd9W;
onchF:
$this->errors[] = sprintf("\111\156\166\141\154\151\x64\40\166\x61\154\x75\145\x20\146\157\x72\x20\133\45\163\135\54\x20\x6d\x69\x6e\x69\x6d\165\x6d\x20\151\x73\40\133\45\163\135", $entityName, $schema->minimum);
goto EaQ30;
Ddd9W:
Gv3C0:
goto RGvUF;
RGvUF:
return $this;
goto KT6VJ;
cdyxB:
if (!isset($schema->minimum)) {
goto Gv3C0;
}
goto oeSj_;
oeSj_:
if (!($entity < $schema->minimum)) {
goto uxyW2;
}
goto onchF;
KT6VJ:
}
protected function checkMaximum($entity, $schema, $entityName)
{
goto n1KF4;
DAs_u:
return $this;
goto x8uIf;
n1KF4:
if (!isset($schema->maximum)) {
goto ZegEB;
}
goto QP5Le;
UBGSn:
ZegEB:
goto DAs_u;
QP5Le:
if (!($entity > $schema->maximum)) {
goto I4EW6;
}
goto KQnoA;
CTjgo:
I4EW6:
goto UBGSn;
KQnoA:
$this->errors[] = sprintf("\x49\156\166\141\x6c\151\x64\40\x76\x61\154\165\145\40\x66\157\x72\40\x5b\45\x73\x5d\54\40\x6d\x61\170\151\155\165\155\x20\x69\x73\40\133\x25\163\x5d", $entityName, $schema->maximum);
goto CTjgo;
x8uIf:
}
protected function checkExclusiveMinimum($entity, $schema, $entityName)
{
goto xVxyi;
F0Tib:
dBHML:
goto wfj9m;
wRZPV:
$this->errors[] = sprintf("\x49\156\166\x61\x6c\151\144\x20\166\x61\154\165\145\x20\x66\157\162\40\x5b\x25\x73\x5d\x2c\x20\x6d\x75\163\x74\x20\x62\145\40\x67\162\x65\141\x74\145\x72\40\164\150\141\156\40\x5b\x25\x73\135", $entityName, $schema->minimum);
goto F0Tib;
Wj6Qs:
return $this;
goto z2hgS;
wfj9m:
G2xZ7:
goto Wj6Qs;
qqETn:
if (!($entity == $schema->minimum)) {
goto dBHML;
}
goto wRZPV;
xVxyi:
if (!(isset($schema->minimum) && isset($schema->exclusiveMinimum) && $schema->exclusiveMinimum)) {
goto G2xZ7;
}
goto qqETn;
z2hgS:
}
protected function checkExclusiveMaximum($entity, $schema, $entityName)
{
goto yhvDG;
BEnKt:
Hd_a1:
goto mUZWN;
eTPyo:
if (!($entity == $schema->maximum)) {
goto PcN0H;
}
goto dtqmH;
mUZWN:
return $this;
goto oz4K2;
dtqmH:
$this->errors[] = sprintf("\111\156\166\141\x6c\151\x64\40\166\141\x6c\x75\x65\40\146\157\x72\40\x5b\45\x73\x5d\x2c\40\x6d\165\163\x74\x20\142\x65\40\154\145\x73\163\40\164\150\x61\x6e\x20\x5b\45\x73\135", $entityName, $schema->maximum);
goto aVj8k;
aVj8k:
PcN0H:
goto BEnKt;
yhvDG:
if (!(isset($schema->maximum) && isset($schema->exclusiveMaximum) && $schema->exclusiveMaximum)) {
goto Hd_a1;
}
goto eTPyo;
oz4K2:
}
protected function checkPattern($entity, $schema, $entityName)
{
goto SpOog;
FaQBA:
NOeny:
goto I30y2;
SpOog:
if (!(isset($schema->pattern) && $schema->pattern)) {
goto NOeny;
}
goto FaQBA;
I30y2:
return $this;
goto UfAsU;
UfAsU:
}
protected function checkMinLength($entity, $schema, $entityName)
{
goto PuKzs;
kQapK:
xyOkK:
goto LqPK8;
ncMeM:
$this->errors[] = sprintf("\123\x74\162\x69\156\147\x20\164\157\x6f\40\163\x68\x6f\162\164\x20\x66\x6f\x72\40\x5b\x25\x73\135\x2c\40\x6d\x69\x6e\x69\155\165\155\40\x6c\145\x6e\147\164\150\x20\x69\x73\40\x5b\x25\163\x5d", $entityName, $schema->minLength);
goto V54VV;
PuKzs:
if (!(isset($schema->minLength) && $schema->minLength)) {
goto xyOkK;
}
goto yELqF;
LqPK8:
return $this;
goto sERNS;
yELqF:
if (!(strlen($entity) < $schema->minLength)) {
goto ABh36;
}
goto ncMeM;
V54VV:
ABh36:
goto kQapK;
sERNS:
}
protected function checkMaxLength($entity, $schema, $entityName)
{
goto giEdG;
Xeg4A:
if (!(strlen($entity) > $schema->maxLength)) {
goto Zjguk;
}
goto MSKF0;
MSKF0:
$this->errors[] = sprintf("\123\x74\x72\x69\156\147\x20\164\x6f\x6f\40\154\x6f\156\x67\40\146\x6f\x72\40\133\x25\163\135\x2c\x20\x6d\x61\x78\x69\x6d\165\x6d\x20\x6c\145\x6e\x67\164\x68\x20\151\163\40\133\x25\163\135", $entityName, $schema->maxLength);
goto OMLCZ;
giEdG:
if (!(isset($schema->maxLength) && $schema->maxLength)) {
goto fcklk;
}
goto Xeg4A;
OMLCZ:
Zjguk:
goto KF6mY;
W2l3T:
return $this;
goto YpSkr;
KF6mY:
fcklk:
goto W2l3T;
YpSkr:
}
protected function checkMinItems($entity, $schema, $entityName)
{
goto u_SoX;
nAoBi:
HfwA0:
goto DccYt;
QuAjv:
$this->errors[] = sprintf("\116\157\164\x20\x65\x6e\157\165\x67\x68\40\141\162\x72\141\171\40\x69\164\x65\x6d\x73\40\146\x6f\x72\40\x5b\x25\163\x5d\54\40\155\151\156\x69\155\x75\155\40\x69\163\40\x5b\45\163\x5d", $entityName, $schema->minItems);
goto nAoBi;
qfP50:
return $this;
goto axA_T;
DccYt:
Ze0U3:
goto qfP50;
u_SoX:
if (!(isset($schema->minItems) && $schema->minItems)) {
goto Ze0U3;
}
goto uX9hB;
uX9hB:
if (!(count($entity) < $schema->minItems)) {
goto HfwA0;
}
goto QuAjv;
axA_T:
}
protected function checkMaxItems($entity, $schema, $entityName)
{
goto tDK2w;
l7qwp:
if (!(count($entity) > $schema->maxItems)) {
goto lwr3L;
}
goto P6QcZ;
hrQ2k:
lwr3L:
goto xHA1e;
P6QcZ:
$this->errors[] = sprintf("\124\x6f\157\x20\155\x61\156\x79\x20\x61\162\162\141\x79\x20\x69\164\x65\x6d\x73\x20\x66\157\162\x20\133\45\163\x5d\x2c\x20\155\141\170\151\x6d\x75\x6d\40\x69\x73\x20\x5b\x25\163\x5d", $entityName, $schema->maxItems);
goto hrQ2k;
gf81t:
return $this;
goto SFJeW;
xHA1e:
P95wR:
goto gf81t;
tDK2w:
if (!(isset($schema->maxItems) && $schema->maxItems)) {
goto P95wR;
}
goto l7qwp;
SFJeW:
}
protected function checkUniqueItems($entity, $schema, $entityName)
{
goto XuwUQ;
tnfms:
qFOhW:
goto n6MDY;
ne1_J:
if (!(count(array_unique($entity)) != count($entity))) {
goto Zwqd0;
}
goto vG9Et;
XuwUQ:
if (!(isset($schema->uniqueItems) && $schema->uniqueItems)) {
goto qFOhW;
}
goto ne1_J;
wjNtp:
Zwqd0:
goto tnfms;
n6MDY:
return $this;
goto BZvxN;
vG9Et:
$this->errors[] = sprintf("\101\x6c\154\x20\151\164\145\x6d\x73\40\151\156\40\141\162\162\x61\x79\x20\133\45\163\x5d\x20\155\x75\x73\x74\40\x62\x65\x20\165\156\x69\x71\x75\145", $entityName);
goto wjNtp;
BZvxN:
}
protected function checkEnum($entity, $schema, $entityName)
{
goto xgOAZ;
np5o9:
if (!(isset($schema->enum) && $schema->enum)) {
goto lsTUO;
}
goto jTd0f;
g7C_T:
lsTUO:
goto hfwbs;
wcrI9:
$valid = false;
goto lcJ28;
BwoB3:
throw new SchemaException(sprintf("\x45\156\165\x6d\40\x70\162\x6f\x70\145\162\164\x79\x20\155\x75\x73\x74\x20\142\x65\x20\x61\156\x20\141\x72\x72\x61\171\40\x66\x6f\162\40\133\x25\163\x5d", $entityName));
goto F1dFk;
s1eON:
foreach ($entity as $val) {
goto Zmg0S;
zm_5x:
$valid = false;
goto MrKw1;
iqO5d:
lKLTP:
goto G8kiK;
Zmg0S:
if (in_array($val, $schema->enum)) {
goto wWjf2;
}
goto zm_5x;
MrKw1:
wWjf2:
goto iqO5d;
G8kiK:
}
goto b_y4I;
b_y4I:
xCL3H:
goto cOer7;
jTd0f:
if (is_array($schema->enum)) {
goto ICvZD;
}
goto BwoB3;
UGpxR:
if (is_array($entity)) {
goto bdzrf;
}
goto dbJ4b;
nSuYZ:
jponr:
goto Q0Ye_;
F1dFk:
ICvZD:
goto UGpxR;
cOer7:
YeH1T:
goto g7C_T;
Sk3UN:
goto YeH1T;
goto ExkQ0;
lcJ28:
BK7r6:
goto Sk3UN;
hfwbs:
if ($valid) {
goto jponr;
}
goto uN4k2;
ExkQ0:
bdzrf:
goto s1eON;
dbJ4b:
if (in_array($entity, $schema->enum)) {
goto BK7r6;
}
goto wcrI9;
xgOAZ:
$valid = true;
goto np5o9;
Q0Ye_:
return $this;
goto I_Gie;
uN4k2:
$this->errors[] = sprintf("\x49\x6e\166\141\x6c\x69\144\40\166\141\154\x75\145\x28\x73\51\40\146\157\162\x20\x5b\45\x73\135\x2c\x20\141\x6c\154\157\167\141\x62\154\145\40\166\141\x6c\165\x65\163\40\141\162\145\x20\x5b\x25\163\135\54\x20\x42\165\x74\x20\133\45\163\x5d\40\x67\x69\x76\145\x6e", $entityName, implode("\54", $schema->enum), $entity);
goto nSuYZ;
I_Gie:
}
protected function checkItems($entity, $schema, $entityName)
{
goto did4f;
tmjcd:
goto aU4Qo;
goto U0Gkd;
Rt8nX:
GsRNi:
goto tmjcd;
A8iEs:
if (is_object($schema->items)) {
goto KtqVq;
}
goto RkmdW;
s6xL3:
HIPDu:
goto dwLrH;
dwLrH:
aU4Qo:
goto AcQ18;
QCW0J:
goto GsRNi;
goto x9rGd;
U0Gkd:
Iuotr:
goto wZn2U;
l6fqj:
if (is_array($schema->items)) {
goto Iuotr;
}
goto A8iEs;
lRxAa:
return $this;
goto Sb5fY;
oqCMy:
mYfTP:
goto Rt8nX;
RkmdW:
throw new SchemaException(sprintf("\x49\x6e\166\141\154\x69\144\40\x69\x74\145\155\163\x20\x76\x61\x6c\x75\145\40\146\157\x72\40\133\45\163\135", $entityName));
goto QCW0J;
rXzz8:
foreach ($entity as $index => $node) {
goto Yp5L1;
TpL3N:
bI_Ar:
goto OGWir;
bheKm:
$this->validateType($node, $schema->items, $nodeEntityName);
goto TpL3N;
Yp5L1:
$nodeEntityName = $entityName . "\x5b" . $index . "\135";
goto bheKm;
OGWir:
}
goto oqCMy;
did4f:
if (!(isset($schema->items) && $schema->items)) {
goto wmhdy;
}
goto l6fqj;
wZn2U:
foreach ($entity as $index => $node) {
goto zPUrd;
zPUrd:
$nodeEntityName = $entityName . "\x5b" . $index . "\135";
goto fFcie;
DxTZh:
if ($nodeValid) {
goto nTZZ7;
}
goto Cng4w;
fFcie:
foreach ($schema->items as $item) {
goto DT1lr;
ymW9f:
if (!$nodeValid) {
goto mJNoS;
}
goto TwcW7;
erTqX:
mJNoS:
goto BI5Ui;
DT1lr:
$this->validateType($node, $item, $nodeEntityName);
goto Fzhi8;
TwcW7:
goto B00g3;
goto erTqX;
Fzhi8:
$nodeValid = count($this->errors) > 0 ? false : true;
goto ymW9f;
BI5Ui:
rWd_M:
goto JrJC4;
JrJC4:
}
goto Wb_oJ;
t7fNZ:
$this->errors[] = sprintf("\111\x6e\166\141\154\x69\144\40\x76\x61\154\x75\145\40\x66\x6f\x72\40\x5b\x25\x73\x5d\54\40\x6d\165\163\x74\x20\142\x65\x20\x6f\x6e\145\x20\157\146\x20\x74\150\x65\x20\146\157\x6c\154\157\167\151\x6e\147\40\x74\x79\160\145\x73\x3a\x20\133\45\x73\135", $nodeEntityName, implode("\54\x20", $allowedTypes));
goto sqJq_;
Wb_oJ:
B00g3:
goto DxTZh;
sqJq_:
nTZZ7:
goto a66nc;
a66nc:
d6Jrs:
goto RieN4;
Cng4w:
$allowedTypes = array_map(function ($item) {
return $item->type == "\157\142\x6a\145\143\x74" ? "\x6f\142\x6a\145\143\164\x20\x28\x73\x63\x68\x65\x6d\141\x29" : $item->type;
}, $schema->items);
goto t7fNZ;
RieN4:
}
goto s6xL3;
x9rGd:
KtqVq:
goto rXzz8;
AcQ18:
wmhdy:
goto lRxAa;
Sb5fY:
}
protected function checkDisallow($entity, $schema, $entityName)
{
goto emJxu;
K5XGm:
if ($valid) {
goto dhWd8;
}
goto ZtTuu;
GQM8b:
$this->validateType($entity, $thisSchema, $entityName);
goto TsmWg;
bNGAb:
yIpws:
goto MXvUJ;
JzWqq:
$thisSchema->type = $schema->disallow;
goto UtQB_;
UtQB_:
unset($thisSchema->disallow);
goto GQM8b;
emJxu:
if (!(isset($schema->disallow) && $schema->disallow)) {
goto yIpws;
}
goto VhI11;
G1N6S:
dhWd8:
goto bNGAb;
ZtTuu:
$disallowedTypes = array_map(function ($item) {
return is_object($item) ? "\x6f\x62\152\x65\143\x74\40\x28\x73\143\x68\x65\155\141\x29" : $item;
}, is_array($schema->disallow) ? $schema->disallow : array($schema->disallow));
goto ReqhU;
VhI11:
$thisSchema = clone $schema;
goto JzWqq;
MXvUJ:
return $this;
goto cpIcV;
TsmWg:
$valid = count($this->errors) > 0 ? true : false;
goto K5XGm;
ReqhU:
$this->errors[] = sprintf("\x49\x6e\x76\x61\x6c\151\144\x20\166\141\x6c\165\x65\x20\x66\x6f\x72\40\x5b\x25\x73\135\54\40\144\x69\x73\x61\154\x6c\157\x77\145\144\40\x74\x79\160\145\163\x20\x61\162\x65\40\x5b\x25\163\135", $entityName, implode("\x2c\40", $disallowedTypes));
goto G1N6S;
cpIcV:
}
protected function checkDivisibleBy($entity, $schema, $entityName)
{
goto vaS1J;
vaS1J:
if (!(isset($schema->divisibleBy) && $schema->divisibleBy)) {
goto yWQUd;
}
goto rB9Jf;
L7dUF:
yWQUd:
goto yrTSR;
ObAXN:
l9OUm:
goto L7dUF;
xKE2b:
$this->errors[] = sprintf("\x49\x6e\166\x61\154\151\x64\x20\x76\x61\154\x75\x65\x20\146\x6f\162\40\x5b\45\x73\135\x2c\x20\x6d\x75\163\164\40\x62\145\40\144\151\166\151\163\x69\x62\154\145\40\x62\x79\40\x5b\x25\x64\x5d", $entityName, $schema->divisibleBy);
goto ObAXN;
owr2K:
dvcEB:
goto y5CJq;
y5CJq:
if (!($entity % $schema->divisibleBy != 0)) {
goto l9OUm;
}
goto xKE2b;
rB9Jf:
if (is_numeric($schema->divisibleBy)) {
goto dvcEB;
}
goto rkxaZ;
yrTSR:
return $this;
goto fGThj;
rkxaZ:
throw new SchemaException(sprintf("\111\x6e\x76\141\154\x69\144\x20\x64\151\166\x69\163\151\x62\x6c\145\102\x79\x20\166\x61\154\165\x65\x20\x66\157\162\40\x5b\x25\x73\135\54\x20\155\x75\163\x74\x20\142\x65\40\x6e\165\155\145\x72\151\143", $entityName));
goto owr2K;
fGThj:
}
}
Function Calls
None |
Stats
MD5 | b1583b416a26018bc68f2672ced2786d |
Eval Count | 0 |
Decode Time | 79 ms |