public function hasRoleById(int $roleId): bool
    {
        if (isset($this->roles[$roleId])) {
            return true;
        }

        return false;
    }
public function hasRoleById(int $roleId): bool
    {
        if (isset($this->roles[$roleId])) {
            return true;
        }

        return false;
    }
public function hasRoleById ( int $ roleId ) : bool { if ( isset ( $ this -> roles [ $ roleId ] ) ) { return true ; } return false ; }
Check if an user has a role, use role Id.

@param int $roleId

@return bool
Check if an user has a role use role Id .