Implements \Drupal\Component\Plugin\Context\ContextInterface::getConstraints().
Overrides ContextInterface::getConstraints
public function getConstraints() {
if (empty($this->contextDefinition['class'])) {
throw new ContextException("An error was encountered while trying to validate the context.");
}
return array(
new Type($this->contextDefinition['class']),
);
}