Fix various code.

This commit is contained in:
James Cole
2025-05-27 17:06:15 +02:00
parent d8f512ca3a
commit 2cb14f6b72
123 changed files with 581 additions and 500 deletions

View File

@@ -59,7 +59,7 @@ class AccountForm
private function getAccountsGrouped(array $types, ?AccountRepositoryInterface $repository = null): array
{
if (null === $repository) {
if (!$repository instanceof AccountRepositoryInterface) {
$repository = $this->getAccountRepository();
}
$accountList = $repository->getActiveAccountsByType($types);

View File

@@ -85,14 +85,13 @@ trait FormSupport
{
// Get errors from session:
/** @var null|MessageBag $errors */
$errors = session('errors');
$classes = 'form-group';
$errors = session('errors');
if (null !== $errors && $errors->has($name)) {
$classes = 'form-group has-error has-feedback';
return 'form-group has-error has-feedback';
}
return $classes;
return 'form-group';
}
/**
@@ -112,7 +111,7 @@ trait FormSupport
}
if ($value instanceof Carbon) {
$value = $value->format('Y-m-d');
return $value->format('Y-m-d');
}
return $value;