-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Error with type hint #22
Comments
Ak, I think you're correct. Removing the if checks in the constructor would resolve the issue for title and type, but not the other pre-defined properties. I think the solution is to give them all default values when declared, as an empty string is still easy enough for a caller to detect. (I really dislike nullables unless there's absolutely no other option.) Happy to accept a PR if you get to it before I do. 😄 |
I'm doing it. There is any reason why strict types is declared but disabled? |
Uh. I don't know what that means...? Strict types are declared at the top of the file. They can't be disabled after that in that file. More likely, the tests just didn't happen to catch that use case. |
Oh. Wait, I just realized what you mean. No, that's just me being brain-dead stupid. Thanks for catching it. 😄 Yes, everything should always be strictly typed, always. |
I revised the PR with a new one, but kept all of your commits so that you got credit for them. 😄 3.1 release has been tagged. Assuming I have it setup correctly it should push out to Composer any minute now. Thanks @thomasvargiu! |
Crell\ApiProblem\ApiProblem
sets$title
(and$type
) property only if argument isn't empty, but getters requires a string return value.I think is possible to remove conditions in constructor.
If you enable strict types, currently it would throw an error.
Same thing for other properties, they are
null
by default, but getters' return values aren't nullable.The text was updated successfully, but these errors were encountered: