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

Catch DateTime failure #4097

Merged
merged 2 commits into from
Jan 13, 2021
Merged

Conversation

MGatner
Copy link
Member

@MGatner MGatner commented Jan 12, 2021

Description
If DateTime::createFromFormat fails then it causes unexpected behavior in our own createFromFormat. This checks for failure (return false) and throws an exception.

See: https://www.php.net/manual/en/datetime.createfromformat.php

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • n/a User guide updated
  • Conforms to style guide

@MGatner
Copy link
Member Author

MGatner commented Jan 12, 2021

I'm locking PHPStan since minor updates keep causing CI issues. FYI @samsonasik we will want to do periodic updates but this has been needed for a while.

@samsonasik
Copy link
Member

@MGatner yes, locking version is ok 👍

@samsonasik samsonasik merged commit 453af97 into codeigniter4:develop Jan 13, 2021
@samsonasik
Copy link
Member

Thank you @MGatner

@MGatner MGatner deleted the datetime-format branch January 13, 2021 01:32
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.

3 participants