subjectPrefix = $subjectPrefix; } public function verify(Token $token): void { /** @var Subject $subjectClaim */ $subjectClaim = $token->getPayload()->findClaimByName(Subject::NAME); $subject = ($subjectClaim === null) ? null : $subjectClaim->getValue(); if (!StringHelper::startsWith($subject, $this->subjectPrefix)) { throw new InvalidSubjectException(); } } }