Example #1
0
 /**
  * Constructor.
  *
  * @param string $context
  */
 public function __construct($context)
 {
     $factory = new Factory();
     $factory->setConstraintClass('request body', SchemaConstraint::class);
     $factory->setConstraintClass('response body', SchemaConstraint::class);
     $this->validator = $factory->createInstanceFor($context);
     $this->context = $context;
 }
Example #2
0
 /**
  * Get the type check based on the set check mode.
  *
  * @return TypeCheck\TypeCheckInterface
  */
 protected function getTypeCheck()
 {
     return $this->factory->getTypeCheck();
 }