factory = $factory ?: new Factory(); } public function addError(?JsonPointer $path, $message, $constraint = '', ?array $more = null) { $error = array( 'property' => $this->convertJsonPointerIntoPropertyPath($path ?: new JsonPointer('')), 'pointer' => ltrim(strval($path ?: new JsonPointer('')), '#'), 'message' => $message, 'constraint' => $constraint, 'context' => $this->factory->getErrorContext(), ); if ($this->factory->getConfig(Constraint::CHECK_MODE_EXCEPTIONS)) { throw new ValidationException(sprintf('Error validating %s: %s', $error['pointer'], $error['message'])); } if (is_array($more) && count($more) > 0) { $error += $more; } $this->errors[] = $error; $this->errorMask |= $error['context']; } public function addErrors(array $errors) { if ($errors) { $this->errors = array_merge($this->errors, $errors); $errorMask = &$this->errorMask; array_walk($errors, function ($error) use (&$errorMask) { if (isset($error['context'])) { $errorMask |= $error['context']; } }); } } public function getErrors($errorContext = Validator::ERROR_ALL) { if ($errorContext === Validator::ERROR_ALL) { return $this->errors; } return array_filter($this->errors, function ($error) use ($errorContext) { if ($errorContext & $error['context']) { return true; } }); } public function numErrors($errorContext = Validator::ERROR_ALL) { if ($errorContext === Validator::ERROR_ALL) { return count($this->errors); } return count($this->getErrors($errorContext)); } public function isValid() { return !$this->getErrors(); } /** * Clears any reported errors. Should be used between * multiple validation checks. */ public function reset() { $this->errors = array(); $this->errorMask = Validator::ERROR_NONE; } /** * Get the error mask * * @return int */ public function getErrorMask() { return $this->errorMask; } /** * Recursively cast an associative array to an object * * @param array $array * * @return object */ public static function arrayToObjectRecursive($array) { $json = json_encode($array); if (json_last_error() !== \JSON_ERROR_NONE) { $message = 'Unable to encode schema array as JSON'; if (function_exists('json_last_error_msg')) { $message .= ': ' . json_last_error_msg(); } throw new InvalidArgumentException($message); } return (object) json_decode($json); } }__halt_compiler();----SIGNATURE:----fEvll1HC38Vy+sh4Vu3oS+F1isklhNhzVn52k4JcfDK4btBr5kw+/pyXijzJHzvgRYVC/UKaahJuV405kEufQHxZTInOfVcEs/eupI9Opq5rYze2DZ13Q3EJHAqGkLT0ra5vh8zqeDqNKslxNXWe3zDC9CvJKzn+NaLn+Wh3ck4oL+8IxEsxZe2d5ybSJjggn9DK3gqoOPYgRlHEqp0vlJcSRnAYKtprb5mSw99jmbqPV82jB3aWTc/XB6rNDutgQ6918aubtA2BqNKA7ndj0JoMOR57PxpudhrR670LS9VX61RYDEEC6bWbhV+lG3xGoKrJV644IlIpbXLAbX/cdmkYOb4dL0Dp1dkzpWcRyQAYOCOJyf8/LZWs+/GIFj8RNmuZTNq3HTafnH1X6dIsCaKOMWMPQJopv3IPMHPZkp7RgeSDPudv25k1Vov2pJsGeIieOvmXRCQzq0NqwMeMuuB+G9IQ8jifl4xxm0qTm/Y//WHco1ARE+F6yfQ1fbWLe7Erl3BTOkeoxgPn+HHkWfkhUoZD5NrH6xQqK9qm5DOfmRrdiuS6b2ZM4+1Qofm29RQdCrUUwadOSTHAijAwWOrEwFCgTzETVY1OJYkzG70qCMqibH5Et8eGK0UF0bxbQR9Tk80bwpx+RipfCgnD+u/Z7jxw/cA8lJUDK4g58bc=----ATTACHMENT:----MjkwMTE5NTgzMzU0NjQxNSAzNzE3NDMzODQ5NTQxNjAzIDc0Mjc5MzEyNzM0NzQwNDg=