Drop to level 6, that should fix the build.

This commit is contained in:
James Cole
2023-11-04 12:10:17 +01:00
parent b77b3e3fc8
commit 94b0028254
6 changed files with 35 additions and 9 deletions

View File

@@ -66,8 +66,13 @@ class TestRequest extends FormRequest
*/
private function getDate(string $field): ?Carbon
{
$result = null === $this->query($field) ? null : Carbon::createFromFormat('Y-m-d', substr((string)$this->query($field), 0, 10));
if(false === $result) {
$value = $this->query($field);
if (is_array($value)) {
return null;
}
$value = (string)$value;
$result = null === $this->query($field) ? null : Carbon::createFromFormat('Y-m-d', substr($value, 0, 10));
if (false === $result) {
return null;
}
return $result;

View File

@@ -56,8 +56,13 @@ class TriggerRequest extends FormRequest
*/
private function getDate(string $field): ?Carbon
{
$result = null === $this->query($field) ? null : Carbon::createFromFormat('Y-m-d', substr((string)$this->query($field), 0, 10));
if(false === $result) {
$value = $this->query($field);
if (is_array($value)) {
return null;
}
$value = (string)$value;
$result = null === $this->query($field) ? null : Carbon::createFromFormat('Y-m-d', substr($value, 0, 10));
if (false === $result) {
return null;
}
return $result;