Esempio n. 1
0
 /**
  * @param Message $type
  * @param string Field $field
  */
 public function __construct(Message $type, Field $field)
 {
     $this->type = $type;
     $this->schema = $type->schema();
     $this->field = $field;
     parent::__construct(sprintf('Required field [%s] must be set on message [%s].', $this->field->getName(), $this->schema->getClassName()));
 }
 /**
  * @param Schema $schema
  * @param string $fieldName
  * @param Field $overrideField
  */
 public function __construct(Schema $schema, $fieldName, Field $overrideField)
 {
     $this->schema = $schema;
     $this->existingField = $this->schema->getField($fieldName);
     $this->overrideField = $overrideField;
     parent::__construct(sprintf('Field [%s] override for [%s] is not compatible. Name, Type, Rule and Required must match.', $this->existingField->getName(), $this->schema->getClassName()));
 }
Esempio n. 3
0
 /**
  * @param Schema $schema
  * @param Mixin $originalMixin
  * @param Mixin $duplicateMixin
  */
 public function __construct(Schema $schema, Mixin $originalMixin, Mixin $duplicateMixin)
 {
     $this->schema = $schema;
     $this->originalMixin = $originalMixin;
     $this->duplicateMixin = $duplicateMixin;
     parent::__construct(sprintf('Mixin with id [%s] was already added from [%s] to message [%s].  ' . 'You cannot add multiple versions of the same mixin.', $this->duplicateMixin->getId()->toString(), $this->originalMixin->getId()->toString(), $this->schema->getClassName()));
 }
Esempio n. 4
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()));
 }
Esempio n. 5
0
 /**
  * @param Schema $schema
  * @param string $fieldName
  */
 public function __construct(Schema $schema, $fieldName)
 {
     $this->schema = $schema;
     $this->fieldName = $fieldName;
     parent::__construct(sprintf('Field [%s] is not defined on message [%s].', $this->fieldName, $this->schema->getClassName()));
 }
Esempio n. 6
0
 /**
  * @param Schema $schema
  * @param string $mixinId
  */
 public function __construct(Schema $schema, $mixinId)
 {
     $this->schema = $schema;
     $this->mixinId = $mixinId;
     parent::__construct(sprintf('Mixin [%s] is not defined on message [%s].', $this->mixinId, $this->schema->getClassName()));
 }
Esempio n. 7
0
 /**
  * @param Schema $schema
  * @param string $fieldName
  */
 public function __construct(Schema $schema, $fieldName)
 {
     $this->schema = $schema;
     $this->field = $this->schema->getField($fieldName);
     parent::__construct(sprintf('Field [%s] is already defined on message [%s] and is not overridable.', $this->field->getName(), $this->schema->getClassName()));
 }