public function getContent() { return $this->content; }
public function validate(Json $json, Validator $validator) { $validator->check($json->getContent(), $this->getContent()); if (!$validator->isValid()) { $msg = "JSON does not validate. Violations:" . PHP_EOL; foreach ($validator->getErrors() as $error) { $msg .= sprintf(" - [%s] %s" . PHP_EOL, $error['property'], $error['message']); } throw new \Exception($msg); } return true; }