Ejemplo n.º 1
0
 /**
  * @param SchemaId $schemaId
  * @param string   $curieWithMajorRev
  *
  * @return SchemaDescriptor|null
  *
  * @throws \InvalidArgumentException
  * @throws MissingSchema
  */
 private function getMixin(SchemaId $schemaId, $curieWithMajorRev)
 {
     if ($curieWithMajorRev == $schemaId->getCurieWithMajorRev()) {
         throw new \InvalidArgumentException(sprintf('Cannot add yourself "%s" as to mixins.', $schemaId->toString()));
     }
     if (!($schema = SchemaStore::getSchemaById($curieWithMajorRev, true))) {
         throw new MissingSchema($curieWithMajorRev);
     }
     return $schema;
 }
Ejemplo n.º 2
0
 /**
  * @return string
  */
 public function toString()
 {
     return $this->id->toString();
 }