Auto commit for release 'develop' on 2024-03-18

This commit is contained in:
github-actions
2024-03-18 20:25:30 +01:00
parent db0dbcfcf1
commit 9aa90650b4
108 changed files with 528 additions and 529 deletions

View File

@@ -40,7 +40,7 @@ class Amount
*
* @throws FireflyException
*/
public function formatAnything(TransactionCurrency $format, string $amount, bool $coloured = null): string
public function formatAnything(TransactionCurrency $format, string $amount, ?bool $coloured = null): string
{
return $this->formatFlat($format->symbol, $format->decimal_places, $amount, $coloured);
}
@@ -53,7 +53,7 @@ class Amount
*
* @SuppressWarnings(PHPMD.MissingImport)
*/
public function formatFlat(string $symbol, int $decimalPlaces, string $amount, bool $coloured = null): string
public function formatFlat(string $symbol, int $decimalPlaces, string $amount, ?bool $coloured = null): string
{
$locale = app('steam')->getLocale();
$rounded = app('steam')->bcround($amount, $decimalPlaces);

View File

@@ -40,7 +40,7 @@ class ExpandedForm
*
* @throws FireflyException
*/
public function amountNoCurrency(string $name, $value = null, array $options = null): string
public function amountNoCurrency(string $name, $value = null, ?array $options = null): string
{
$options ??= [];
$label = $this->label($name, $options);
@@ -71,7 +71,7 @@ class ExpandedForm
*
* @throws FireflyException
*/
public function checkbox(string $name, int $value = null, $checked = null, array $options = null): string
public function checkbox(string $name, ?int $value = null, $checked = null, ?array $options = null): string
{
$options ??= [];
$value ??= 1;
@@ -106,7 +106,7 @@ class ExpandedForm
*
* @throws FireflyException
*/
public function date(string $name, $value = null, array $options = null): string
public function date(string $name, $value = null, ?array $options = null): string
{
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
@@ -129,7 +129,7 @@ class ExpandedForm
/**
* @throws FireflyException
*/
public function file(string $name, array $options = null): string
public function file(string $name, ?array $options = null): string
{
$options ??= [];
$label = $this->label($name, $options);
@@ -153,7 +153,7 @@ class ExpandedForm
*
* @throws FireflyException
*/
public function integer(string $name, $value = null, array $options = null): string
public function integer(string $name, $value = null, ?array $options = null): string
{
$options ??= [];
$label = $this->label($name, $options);
@@ -179,7 +179,7 @@ class ExpandedForm
*
* @throws FireflyException
*/
public function location(string $name, $value = null, array $options = null): string
public function location(string $name, $value = null, ?array $options = null): string
{
$options ??= [];
$label = $this->label($name, $options);
@@ -227,7 +227,7 @@ class ExpandedForm
*
* @throws FireflyException
*/
public function objectGroup($value = null, array $options = null): string
public function objectGroup($value = null, ?array $options = null): string
{
$name = 'object_group';
$label = $this->label($name, $options);
@@ -272,7 +272,7 @@ class ExpandedForm
/**
* @throws FireflyException
*/
public function password(string $name, array $options = null): string
public function password(string $name, ?array $options = null): string
{
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
@@ -297,7 +297,7 @@ class ExpandedForm
*
* @throws FireflyException
*/
public function percentage(string $name, $value = null, array $options = null): string
public function percentage(string $name, $value = null, ?array $options = null): string
{
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
@@ -323,7 +323,7 @@ class ExpandedForm
*
* @throws FireflyException
*/
public function staticText(string $name, $value, array $options = null): string
public function staticText(string $name, $value, ?array $options = null): string
{
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
@@ -346,7 +346,7 @@ class ExpandedForm
*
* @throws FireflyException
*/
public function text(string $name, $value = null, array $options = null): string
public function text(string $name, $value = null, ?array $options = null): string
{
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
@@ -370,7 +370,7 @@ class ExpandedForm
*
* @throws FireflyException
*/
public function textarea(string $name, $value = null, array $options = null): string
public function textarea(string $name, $value = null, ?array $options = null): string
{
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);

View File

@@ -43,7 +43,7 @@ class AccountForm
/**
* Grouped dropdown list of all accounts that are valid as the destination of a withdrawal.
*/
public function activeDepositDestinations(string $name, mixed $value = null, array $options = null): string
public function activeDepositDestinations(string $name, mixed $value = null, ?array $options = null): string
{
$types = [AccountType::MORTGAGE, AccountType::DEBT, AccountType::CREDITCARD, AccountType::LOAN, AccountType::REVENUE];
$repository = $this->getAccountRepository();
@@ -55,7 +55,7 @@ class AccountForm
return $this->select($name, $grouped, $value, $options);
}
private function getAccountsGrouped(array $types, AccountRepositoryInterface $repository = null): array
private function getAccountsGrouped(array $types, ?AccountRepositoryInterface $repository = null): array
{
if (null === $repository) {
$repository = $this->getAccountRepository();
@@ -89,7 +89,7 @@ class AccountForm
/**
* Grouped dropdown list of all accounts that are valid as the destination of a withdrawal.
*/
public function activeWithdrawalDestinations(string $name, mixed $value = null, array $options = null): string
public function activeWithdrawalDestinations(string $name, mixed $value = null, ?array $options = null): string
{
$types = [AccountType::MORTGAGE, AccountType::DEBT, AccountType::CREDITCARD, AccountType::LOAN, AccountType::EXPENSE];
$repository = $this->getAccountRepository();
@@ -107,7 +107,7 @@ class AccountForm
*
* @throws FireflyException
*/
public function assetAccountCheckList(string $name, array $options = null): string
public function assetAccountCheckList(string $name, ?array $options = null): string
{
$options ??= [];
$label = $this->label($name, $options);
@@ -138,7 +138,7 @@ class AccountForm
*
* @param mixed $value
*/
public function assetAccountList(string $name, $value = null, array $options = null): string
public function assetAccountList(string $name, $value = null, ?array $options = null): string
{
$types = [AccountType::ASSET, AccountType::DEFAULT];
$grouped = $this->getAccountsGrouped($types);
@@ -151,7 +151,7 @@ class AccountForm
*
* @param mixed $value
*/
public function longAccountList(string $name, $value = null, array $options = null): string
public function longAccountList(string $name, $value = null, ?array $options = null): string
{
$types = [AccountType::ASSET, AccountType::DEFAULT, AccountType::MORTGAGE, AccountType::DEBT, AccountType::CREDITCARD, AccountType::LOAN];
$grouped = $this->getAccountsGrouped($types);

View File

@@ -42,7 +42,7 @@ class CurrencyForm
*
* @throws FireflyException
*/
public function amount(string $name, $value = null, array $options = null): string
public function amount(string $name, $value = null, ?array $options = null): string
{
return $this->currencyField($name, 'amount', $value, $options);
}
@@ -50,7 +50,7 @@ class CurrencyForm
/**
* @throws FireflyException
*/
protected function currencyField(string $name, string $view, mixed $value = null, array $options = null): string
protected function currencyField(string $name, string $view, mixed $value = null, ?array $options = null): string
{
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
@@ -106,7 +106,7 @@ class CurrencyForm
*
* @throws FireflyException
*/
public function balanceAll(string $name, $value = null, array $options = null): string
public function balanceAll(string $name, $value = null, ?array $options = null): string
{
return $this->allCurrencyField($name, 'balance', $value, $options);
}
@@ -118,7 +118,7 @@ class CurrencyForm
*
* @throws FireflyException
*/
protected function allCurrencyField(string $name, string $view, $value = null, array $options = null): string
protected function allCurrencyField(string $name, string $view, $value = null, ?array $options = null): string
{
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
@@ -173,7 +173,7 @@ class CurrencyForm
*
* @param mixed $value
*/
public function currencyList(string $name, $value = null, array $options = null): string
public function currencyList(string $name, $value = null, ?array $options = null): string
{
/** @var CurrencyRepositoryInterface $currencyRepos */
$currencyRepos = app(CurrencyRepositoryInterface::class);
@@ -195,7 +195,7 @@ class CurrencyForm
*
* @param mixed $value
*/
public function currencyListEmpty(string $name, $value = null, array $options = null): string
public function currencyListEmpty(string $name, $value = null, ?array $options = null): string
{
/** @var CurrencyRepositoryInterface $currencyRepos */
$currencyRepos = app(CurrencyRepositoryInterface::class);

View File

@@ -36,7 +36,7 @@ trait FormSupport
/**
* @param mixed $selected
*/
public function select(string $name, array $list = null, $selected = null, array $options = null): string
public function select(string $name, ?array $list = null, $selected = null, ?array $options = null): string
{
$list ??= [];
$label = $this->label($name, $options);
@@ -55,7 +55,7 @@ trait FormSupport
return $html;
}
protected function label(string $name, array $options = null): string
protected function label(string $name, ?array $options = null): string
{
$options ??= [];
if (array_key_exists('label', $options)) {
@@ -69,7 +69,7 @@ trait FormSupport
/**
* @param mixed $label
*/
protected function expandOptionArray(string $name, $label, array $options = null): array
protected function expandOptionArray(string $name, $label, ?array $options = null): array
{
$options ??= [];
$name = str_replace('[]', '', $name);

View File

@@ -40,7 +40,7 @@ class PiggyBankForm
*
* @param mixed $value
*/
public function piggyBankList(string $name, $value = null, array $options = null): string
public function piggyBankList(string $name, $value = null, ?array $options = null): string
{
// make repositories
/** @var PiggyBankRepositoryInterface $repository */

View File

@@ -34,7 +34,7 @@ class RuleForm
{
use FormSupport;
public function ruleGroupList(string $name, mixed $value = null, array $options = null): string
public function ruleGroupList(string $name, mixed $value = null, ?array $options = null): string
{
/** @var RuleGroupRepositoryInterface $groupRepos */
$groupRepos = app(RuleGroupRepositoryInterface::class);
@@ -54,7 +54,7 @@ class RuleForm
/**
* @param null $value
*/
public function ruleGroupListWithEmpty(string $name, $value = null, array $options = null): string
public function ruleGroupListWithEmpty(string $name, $value = null, ?array $options = null): string
{
$options ??= [];
$options['class'] = 'form-control';

View File

@@ -38,7 +38,7 @@ class Navigation
{
private Calculator $calculator;
public function __construct(Calculator $calculator = null)
public function __construct(?Calculator $calculator = null)
{
$this->calculator = $calculator instanceof Calculator ? $calculator : new Calculator();
}
@@ -631,7 +631,7 @@ class Navigation
/**
* @throws FireflyException
*/
public function subtractPeriod(Carbon $theDate, string $repeatFreq, int $subtract = null): Carbon
public function subtractPeriod(Carbon $theDate, string $repeatFreq, ?int $subtract = null): Carbon
{
$subtract ??= 1;
$date = clone $theDate;

View File

@@ -851,7 +851,7 @@ class Steam
return number_format((float)$value, 0, '.', '');
}
public function opposite(string $amount = null): ?string
public function opposite(?string $amount = null): ?string
{
if (null === $amount) {
return null;

View File

@@ -87,7 +87,7 @@ class AmountFormat extends AbstractExtension
{
return new TwigFunction(
'formatAmountByAccount',
static function (AccountModel $account, string $amount, bool $coloured = null): string {
static function (AccountModel $account, string $amount, ?bool $coloured = null): string {
$coloured ??= true;
/** @var AccountRepositoryInterface $accountRepos */
@@ -107,7 +107,7 @@ class AmountFormat extends AbstractExtension
{
return new TwigFunction(
'formatAmountBySymbol',
static function (string $amount, string $symbol, int $decimalPlaces = null, bool $coloured = null): string {
static function (string $amount, string $symbol, ?int $decimalPlaces = null, ?bool $coloured = null): string {
$decimalPlaces ??= 2;
$coloured ??= true;
$currency = new TransactionCurrency();
@@ -127,7 +127,7 @@ class AmountFormat extends AbstractExtension
{
return new TwigFunction(
'formatAmountByCurrency',
static function (TransactionCurrency $currency, string $amount, bool $coloured = null): string {
static function (TransactionCurrency $currency, string $amount, ?bool $coloured = null): string {
$coloured ??= true;
return app('amount')->formatAnything($currency, $amount, $coloured);