/** * @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; }
/** * @return string */ public function toString() { return $this->id->toString(); }