Code cleanup.

This commit is contained in:
James Cole
2023-12-20 19:35:52 +01:00
parent c4f6366642
commit 64ec0cf62e
997 changed files with 12908 additions and 28136 deletions

View File

@@ -25,7 +25,6 @@ namespace FireflyIII\Support\Form;
use FireflyIII\Models\RuleGroup;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
use Form;
/**
* Class RuleForm
@@ -35,13 +34,6 @@ class RuleForm
{
use FormSupport;
/**
* @param string $name
* @param mixed $value
* @param array|null $options
*
* @return string
*/
public function ruleGroupList(string $name, mixed $value = null, array $options = null): string
{
/** @var RuleGroupRepositoryInterface $groupRepos */
@@ -50,6 +42,7 @@ class RuleForm
// get all currencies:
$list = $groupRepos->get();
$array = [];
/** @var RuleGroup $group */
foreach ($list as $group) {
$array[$group->id] = $group->title;
@@ -59,16 +52,13 @@ class RuleForm
}
/**
* @param string $name
* @param null $value
* @param array|null $options
*
* @return string
* @param null $value
*/
public function ruleGroupListWithEmpty(string $name, $value = null, array $options = null): string
{
$options ??= [];
$options['class'] = 'form-control';
/** @var RuleGroupRepositoryInterface $groupRepos */
$groupRepos = app(RuleGroupRepositoryInterface::class);
@@ -77,6 +67,7 @@ class RuleForm
$array = [
0 => (string)trans('firefly.none_in_select_list'),
];
/** @var RuleGroup $group */
foreach ($list as $group) {
if (array_key_exists('hidden', $options) && (int)$options['hidden'] !== $group->id) {