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

Some simplifications and code polish #59

Merged
merged 11 commits into from
Sep 7, 2024

Conversation

Philipp91
Copy link
Contributor

See the individual commit messages and diffs.

Breaking changes:

  • ext-json is now declared as a dependency. It was actually a dependency before, but now it's declared, which might break some builds.
  • Request::getBody() was renamed to Request::buildJsonBody(). Most clients won't care, as they don't call this function.
  • FcmClient::send() does not throw GuzzleException anymore, but now wraps it into FcmClientException (same exception type as when the server returns an error).

`then` and `minimaly` were misspelled, I'm replacing with simpler / more 
standard wording.
This fixes the `catch` clause in the `send()` function, so the 
user-visible behavior changes in that `FcmClientException` is now thrown 
instead.
As discussed on EdwinHoksberg#48. This is a user-visible breaking API change, though 
most users probably won't care, as they use FcmClient::send() instead.

Also document the NotificationException thrown from there, which existed 
before but just wasn't documented (not a breaking change).
`current()` is broken when someone else previously fiddled with 
iterators on the passed array. `[0]` is guaranteed to work if the array 
has numerical indices, which can be enforced by using `array_values()` 
in `addRecipient()`. Also reject invalid inputs there instead of 
silently dropping them.
@rolinger rolinger merged commit 33b97ba into EdwinHoksberg:master Sep 7, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants