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

Update Date.php #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update Date.php #155

wants to merge 1 commit into from

Conversation

cjavad
Copy link

@cjavad cjavad commented Oct 23, 2022

In a recent project, we've experienced issues using the Date rule filter due to a depracated warning caused by the Date.php rule.

Deprecated...  date_create_from_format(): Passing null to parameter #2 ($datetime) of type string is deprecated in .../vendor/rakit/validation/src/Rules/Date.php

Proposed fix: Default $datetime argument ($value) to an empty string over null to prevent a deprecation warning. I am unsure whether this approach is up to the standards of this code base but it was a viable fix to our problem.

Default $datetime argument ($value) to an empty string over `null` to prevent a deprecation warning.
@cjavad
Copy link
Author

cjavad commented Oct 23, 2022

Currently we circumwent this by using a custom validator for dates (affectionally called Date2) that we use instead of the default date rule.

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.

1 participant