コード例 #1
0
ファイル: PhpGenerator.php プロジェクト: gdbots/pbj
 /**
  * {@inheritdoc}
  */
 protected function getSchemaTemplates(SchemaDescriptor $schema)
 {
     return $schema->isMixinSchema() ? ['curie-interface.twig' => '{className}', 'curie-major-interface.twig' => '{className}V{major}', 'mixin.twig' => '{className}V{major}Mixin', 'trait.twig' => '{className}V{major}Trait'] : ['curie-interface.twig' => '{className}', 'message.twig' => '{className}V{major}'];
 }
コード例 #2
0
ファイル: SchemaIsMixin.php プロジェクト: gdbots/pbj
 /**
  * {@inheritdoc}
  */
 public function validate(SchemaDescriptor $a, SchemaDescriptor $b)
 {
     if ($a->isMixinSchema() && !$b->isMixinSchema()) {
         throw new ValidatorException(sprintf('The schema "%s" must be a mixin.', $b));
     }
 }