Skip to content

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