mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Code cleanup.
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user