Ejemplo n.º 1
0
 /**
  * @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()));
 }
Ejemplo n.º 2
0
 /**
  * @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];
 }
Ejemplo n.º 3
0
 /**
  * @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()));
 }
Ejemplo n.º 4
0
 /**
  * @return string
  */
 public function __toString()
 {
     return $this->id->toString();
 }