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

If upstream call fails throw exception as well #1

Closed
tomasfejfar opened this issue Oct 10, 2016 · 3 comments
Closed

If upstream call fails throw exception as well #1

tomasfejfar opened this issue Oct 10, 2016 · 3 comments

Comments

@tomasfejfar
Copy link
Owner

The expression \DateTime::createFromFor...mat, $time, $timezone); of type DateTime|false adds false to the return on line 27 which is incompatible with the return type documented by TomasFejfar\DateTime\Dat...trict::createFromFormat of type DateTime.

@tomasfejfar
Copy link
Owner Author

I'd like the method to throw exception as well if the internal createFromFormat returns false.

@aautar
Copy link
Contributor

aautar commented Oct 11, 2016

Seemed simple:
#2

However, I couldn't find a case where \DateTime::createFromFormat() returns false, but there are no warning or errors. If you know of a case, I can write a test.

@tomasfejfar
Copy link
Owner Author

You are certainly right. But I thought that it would be a nice to handle the edge case anyway to make it futureproof. Also I thought it would be a nice easy pullrequest for someone to do for hacktoberfest :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants