Skip to content

Make the parameter "realm" optional #173

@foliengriller

Description

@foliengriller

Currently, each call needs a parameter "realm" as first argument. As we only have one realm we are working with (we do not use the master realm), this parameter does not make lot of sense for us. As the realm is already defined in the httpClient, it could be taken from there and overwritten if necessary.

So my proposal would be as follows:

public function get(string $userId, ?string $realm = null): UserRepresentation
    {
        $realm = $this->getRealm($realm);
       ....

and, in Resource.php

    public function getRealm(string|null $realm): string
    {
        if (!$realm) {
            return $this->realm;
        }

        return $realm;
    }

I can try to create a merge request, but as it will be a breaking change, I want to ask first. Maybe there is also a better approach to solve the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions