/** * @param SchemaDescriptor $schema * * @return array */ private function getExtendsSchemas(SchemaDescriptor $schema) { $schemaIds = []; $check = $schema->getExtends(); while ($check) { $schemaIds[] = $check->getId()->getCurieWithMajorRev(); $check = $check->getExtends(); } return $schemaIds; }
/** * {@inheritdoc} */ public function validate(SchemaDescriptor $a, SchemaDescriptor $b) { if ($a->getExtends() != $b->getExtends()) { throw new ValidatorException(sprintf('The schema "%s" must extends "%s".', $b, $a->getExtends()->getId()->toString())); } }