Fix various code things.

This commit is contained in:
James Cole
2023-11-04 19:20:07 +01:00
parent e51fef3037
commit 688f50ee3f
16 changed files with 32 additions and 28 deletions

View File

@@ -355,7 +355,7 @@ trait ConvertsDataTypes
foreach ($fields as $field => $info) {
if ($this->has($info[0])) {
$method = $info[1];
$return[$field] = $this->$method($info[0]);
$return[$field] = $this->$method($info[0]); // @phpstan-ignore-line
}
}
@@ -383,7 +383,7 @@ trait ConvertsDataTypes
{
$result = null;
try {
$result = $this->get($field) ? new Carbon($this->get($field), config('app.timezone')) : null;
$result = '' !== (string) $this->get($field) ? new Carbon((string)$this->get($field), config('app.timezone')) : null;
} catch (InvalidFormatException $e) {
// @ignoreException
}