/** * Check if the constraint is met. * * @param mixed $value * @param array $context * * @throws UnknownTypeException * @return mixed */ public function check($value, array $context = []) { $hound = new TypeHound($value); return $this->expectedType === $hound->resolve(); }
/** * Check that the type matches. * * @param TypeHound $other * * @throws UnknownTypeException * @return bool */ public function matches(TypeHound $other) { return $this->resolve() === $other->resolve(); }