Crell / ApiProblem

A simple implementation of the api-problem specification. Includes PSR-15 support.
MIT License
239 stars 21 forks source link

Removing empty usage on decoding #35

Closed nyamsprod closed 3 years ago

nyamsprod commented 3 years ago

As a follow up to #33 I'm also removing empty usage on decompiling the Problem object to remove the following bug

<?php

echo ApiProblem::fromJson('{"type":"0"}')->asJson();
// expected {"type":"0"} but got {"type":"about:blank"} instead
nyamsprod commented 3 years ago

I could replace the use of filter_var with intval and strval if you want to rely on functions only present in core. What do you think ?

nyamsprod commented 3 years ago

I've updated the PR by adding 2 static protected methods filterStringValue and filterIntValue

Crell commented 3 years ago

Dur. I thought I told Scrutinizer to buzz off.

Crell commented 3 years ago

I really hate loose typing... :smile:

Any other updates you have in mind? I don't want to have too many more tags in rapid succession.

nyamsprod commented 3 years ago

At the moment no those are just issues I stumble on during CI/CD tests. From my part it should be fine for now. If you can wait 1 week I'll come back to you with a definitive go ahead from my part.

Crell commented 3 years ago

:+1:

nyamsprod commented 3 years ago

@Crell all is good you can proceed with the release 😉👌🏾