subject = $subject; } public function assert(Token $token) { if (!$token->isRelatedTo($this->subject)) { throw new ConstraintViolation('The token is not related to the expected subject'); } } }