id = $id; } public function assert(Token $token) { if (!$token->isIdentifiedBy($this->id)) { throw new ConstraintViolation('The token is not identified with the expected ID'); } } }