/** * @param Schema $schema * @param SchemaId $resolvedSchemaId * @param string $resolvedClassName */ public function __construct(Schema $schema, SchemaId $resolvedSchemaId, $resolvedClassName) { $this->schema = $schema; $this->resolvedSchemaId = $resolvedSchemaId; $this->resolvedClassName = $resolvedClassName; parent::__construct(sprintf('Schema id [%s] with curie [%s] was resolved to [%s] but ' . 'that message has a curie of [%s]. They must match.', $this->resolvedSchemaId->toString(), $this->resolvedSchemaId->getCurieMajor(), $resolvedClassName, $this->schema->getId()->getCurieMajor())); }
/** * @param SchemaId $id * @return SchemaCurie */ public static function fromId(SchemaId $id) { $curie = substr(str_replace(':' . $id->getVersion()->toString(), '', $id->toString()), 4); if (isset(self::$instances[$curie])) { return self::$instances[$curie]; } self::$instances[$curie] = new self($id->getVendor(), $id->getPackage(), $id->getCategory(), $id->getMessage()); return self::$instances[$curie]; }
/** * @param SchemaId $schemaId */ public function __construct(SchemaId $schemaId) { $this->schemaId = $schemaId; parent::__construct(sprintf('MessageResolver is unable to resolve schema id [%s] ' . 'using curie [%s] to a class name.', $schemaId->toString(), $schemaId->getCurieMajor())); }
/** * @return string */ public function __toString() { return $this->id->toString(); }