Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor bool return type (breaking change, major release) #99

Open
ndeet opened this issue Feb 22, 2023 · 0 comments
Open

Refactor bool return type (breaking change, major release) #99

ndeet opened this issue Feb 22, 2023 · 0 comments

Comments

@ndeet
Copy link
Collaborator

ndeet commented Feb 22, 2023

We have several places where we only return true in case of success but no false because it throws an exception in that case. As discussed with Wouter we should refactor that to void return type as you have that function in a try/catch block anyway.

e.g. https://github.com/btcpayserver/btcpayserver-greenfield-php/blob/master/src/Client/User.php#L79

if ($response->getStatus() === 200) {
            return true;
        } else {
            throw $this->getExceptionByStatusCode($method, $url, $response);
        }
@ndeet ndeet changed the title Refactor bool return type Refactor bool return type (breaking change, major release) Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant