mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
PHPStorm can order methods by alphabet, who knew.
This commit is contained in:
@@ -47,64 +47,6 @@ class CurrencyForm
|
||||
return $this->currencyField($name, 'amount', $value, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO describe and cleanup.
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function balanceAll(string $name, $value = null, array $options = null): string
|
||||
{
|
||||
return $this->allCurrencyField($name, 'balance', $value, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO cleanup and describe
|
||||
*
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function currencyList(string $name, $value = null, array $options = null): string
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface $currencyRepos */
|
||||
$currencyRepos = app(CurrencyRepositoryInterface::class);
|
||||
|
||||
// get all currencies:
|
||||
$list = $currencyRepos->get();
|
||||
$array = [];
|
||||
|
||||
/** @var TransactionCurrency $currency */
|
||||
foreach ($list as $currency) {
|
||||
$array[$currency->id] = $currency->name.' ('.$currency->symbol.')';
|
||||
}
|
||||
|
||||
return $this->select($name, $array, $value, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO cleanup and describe
|
||||
*
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function currencyListEmpty(string $name, $value = null, array $options = null): string
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface $currencyRepos */
|
||||
$currencyRepos = app(CurrencyRepositoryInterface::class);
|
||||
|
||||
// get all currencies:
|
||||
$list = $currencyRepos->get();
|
||||
$array = [
|
||||
0 => (string)trans('firefly.no_currency'),
|
||||
];
|
||||
|
||||
/** @var TransactionCurrency $currency */
|
||||
foreach ($list as $currency) {
|
||||
$array[$currency->id] = $currency->name.' ('.$currency->symbol.')';
|
||||
}
|
||||
|
||||
return $this->select($name, $array, $value, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
@@ -157,6 +99,18 @@ class CurrencyForm
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO describe and cleanup.
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function balanceAll(string $name, $value = null, array $options = null): string
|
||||
{
|
||||
return $this->allCurrencyField($name, 'balance', $value, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO describe and cleanup
|
||||
*
|
||||
@@ -213,4 +167,50 @@ class CurrencyForm
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO cleanup and describe
|
||||
*
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function currencyList(string $name, $value = null, array $options = null): string
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface $currencyRepos */
|
||||
$currencyRepos = app(CurrencyRepositoryInterface::class);
|
||||
|
||||
// get all currencies:
|
||||
$list = $currencyRepos->get();
|
||||
$array = [];
|
||||
|
||||
/** @var TransactionCurrency $currency */
|
||||
foreach ($list as $currency) {
|
||||
$array[$currency->id] = $currency->name.' ('.$currency->symbol.')';
|
||||
}
|
||||
|
||||
return $this->select($name, $array, $value, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO cleanup and describe
|
||||
*
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function currencyListEmpty(string $name, $value = null, array $options = null): string
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface $currencyRepos */
|
||||
$currencyRepos = app(CurrencyRepositoryInterface::class);
|
||||
|
||||
// get all currencies:
|
||||
$list = $currencyRepos->get();
|
||||
$array = [
|
||||
0 => (string)trans('firefly.no_currency'),
|
||||
];
|
||||
|
||||
/** @var TransactionCurrency $currency */
|
||||
foreach ($list as $currency) {
|
||||
$array[$currency->id] = $currency->name.' ('.$currency->symbol.')';
|
||||
}
|
||||
|
||||
return $this->select($name, $array, $value, $options);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user