validation icon indicating copy to clipboard operation
validation copied to clipboard

Update Date.php

Open cjavad opened this issue 3 years ago • 1 comments
trafficstars

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.

cjavad avatar Oct 23 '22 01:10 cjavad

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

cjavad avatar Oct 23 '22 01:10 cjavad