protected function getSubjectFromUser(IUser $user, ICredential $credential) : ISubject
    {
        $userId = $user->getId();
        $roles = $this->roleRepository->getRoleNamesForSubject($userId);

        return new Subject([new Principal(PrincipalTypes::PRIMARY, $userId, $roles)], [$credential]);
    }
protected function getSubjectFromUser(IUser $user, ICredential $credential) : ISubject
    {
        $userId = $user->getId();
        $roles = $this->roleRepository->getRoleNamesForSubject($userId);

        return new Subject([new Principal(PrincipalTypes::PRIMARY, $userId, $roles)], [$credential]);
    }
protected function getSubjectFromUser ( IUser $ user , ICredential $ credential ) : ISubject { $ userId = $ user -> getId ( ) ; $ roles = $ this -> roleRepository -> getRoleNamesForSubject ( $ userId ) ; return new Subject ( [ new Principal ( PrincipalTypes :: PRIMARY , $ userId , $ roles ) ] , [ $ credential ] ) ; }
Gets a subject from a user

@param IUser $user The user
@param ICredential $credential The credential
@return ISubject The subject
Gets a subject from a user