* @author Bruno Prieto Reis */ class SchemaConstraint extends Constraint { /** * {@inheritDoc} */ public function check($element, $schema = null, $path = null, $i = null) { if ($schema !== null) { // passed schema $this->checkUndefined($element, $schema, '', ''); } elseif (property_exists($element, $this->inlineSchemaProperty)) { // inline schema $this->checkUndefined($element, $element->{$this->inlineSchemaProperty}, '', ''); } else { throw new InvalidArgumentException('no schema found to verify against'); } } }