mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-04 04:24:26 +00:00
Auto commit for release 'develop' on 2024-03-18
This commit is contained in:
@@ -53,40 +53,40 @@ class ForceDecimalSize extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
protected $description = 'This command resizes DECIMAL columns in MySQL or PostgreSQL and correct amounts (only MySQL).';
|
||||
protected $signature = 'firefly-iii:force-decimal-size';
|
||||
protected $description = 'This command resizes DECIMAL columns in MySQL or PostgreSQL and correct amounts (only MySQL).';
|
||||
protected $signature = 'firefly-iii:force-decimal-size';
|
||||
private string $cast;
|
||||
private array $classes
|
||||
= [
|
||||
'accounts' => Account::class,
|
||||
'auto_budgets' => AutoBudget::class,
|
||||
'available_budgets' => AvailableBudget::class,
|
||||
'bills' => Bill::class,
|
||||
'budget_limits' => BudgetLimit::class,
|
||||
'piggy_bank_events' => PiggyBankEvent::class,
|
||||
'piggy_bank_repetitions' => PiggyBankRepetition::class,
|
||||
'piggy_banks' => PiggyBank::class,
|
||||
'recurrences_transactions' => RecurrenceTransaction::class,
|
||||
'transactions' => Transaction::class,
|
||||
];
|
||||
= [
|
||||
'accounts' => Account::class,
|
||||
'auto_budgets' => AutoBudget::class,
|
||||
'available_budgets' => AvailableBudget::class,
|
||||
'bills' => Bill::class,
|
||||
'budget_limits' => BudgetLimit::class,
|
||||
'piggy_bank_events' => PiggyBankEvent::class,
|
||||
'piggy_bank_repetitions' => PiggyBankRepetition::class,
|
||||
'piggy_banks' => PiggyBank::class,
|
||||
'recurrences_transactions' => RecurrenceTransaction::class,
|
||||
'transactions' => Transaction::class,
|
||||
];
|
||||
|
||||
private string $operator;
|
||||
private string $regularExpression;
|
||||
private array $tables
|
||||
= [
|
||||
'accounts' => ['virtual_balance'],
|
||||
'auto_budgets' => ['amount'],
|
||||
'available_budgets' => ['amount'],
|
||||
'bills' => ['amount_min', 'amount_max'],
|
||||
'budget_limits' => ['amount'],
|
||||
'currency_exchange_rates' => ['rate', 'user_rate'],
|
||||
'limit_repetitions' => ['amount'],
|
||||
'piggy_bank_events' => ['amount'],
|
||||
'piggy_bank_repetitions' => ['currentamount'],
|
||||
'piggy_banks' => ['targetamount'],
|
||||
'recurrences_transactions' => ['amount', 'foreign_amount'],
|
||||
'transactions' => ['amount', 'foreign_amount'],
|
||||
];
|
||||
= [
|
||||
'accounts' => ['virtual_balance'],
|
||||
'auto_budgets' => ['amount'],
|
||||
'available_budgets' => ['amount'],
|
||||
'bills' => ['amount_min', 'amount_max'],
|
||||
'budget_limits' => ['amount'],
|
||||
'currency_exchange_rates' => ['rate', 'user_rate'],
|
||||
'limit_repetitions' => ['amount'],
|
||||
'piggy_bank_events' => ['amount'],
|
||||
'piggy_bank_repetitions' => ['currentamount'],
|
||||
'piggy_banks' => ['targetamount'],
|
||||
'recurrences_transactions' => ['amount', 'foreign_amount'],
|
||||
'transactions' => ['amount', 'foreign_amount'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
|
||||
@@ -75,7 +75,7 @@ class ReconcileController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
* */
|
||||
public function reconcile(Account $account, Carbon $start = null, Carbon $end = null)
|
||||
public function reconcile(Account $account, ?Carbon $start = null, ?Carbon $end = null)
|
||||
{
|
||||
if (!$this->isEditableAccount($account)) {
|
||||
return $this->redirectAccountToAccount($account);
|
||||
|
||||
@@ -75,7 +75,7 @@ class ShowController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
* */
|
||||
public function show(Request $request, Account $account, Carbon $start = null, Carbon $end = null)
|
||||
public function show(Request $request, Account $account, ?Carbon $start = null, ?Carbon $end = null)
|
||||
{
|
||||
$objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type));
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ class IndexController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
* */
|
||||
public function index(Carbon $start = null, Carbon $end = null)
|
||||
public function index(?Carbon $start = null, ?Carbon $end = null)
|
||||
{
|
||||
$this->abRepository->cleanup();
|
||||
app('log')->debug(sprintf('Start of IndexController::index("%s", "%s")', $start?->format('Y-m-d'), $end?->format('Y-m-d')));
|
||||
|
||||
@@ -75,7 +75,7 @@ class ShowController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function noBudget(Request $request, Carbon $start = null, Carbon $end = null)
|
||||
public function noBudget(Request $request, ?Carbon $start = null, ?Carbon $end = null)
|
||||
{
|
||||
// @var Carbon $start
|
||||
$start ??= session('start');
|
||||
|
||||
@@ -70,7 +70,7 @@ class NoCategoryController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function show(Request $request, Carbon $start = null, Carbon $end = null)
|
||||
public function show(Request $request, ?Carbon $start = null, ?Carbon $end = null)
|
||||
{
|
||||
app('log')->debug('Start of noCategory()');
|
||||
// @var Carbon $start
|
||||
|
||||
@@ -71,7 +71,7 @@ class ShowController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function show(Request $request, Category $category, Carbon $start = null, Carbon $end = null)
|
||||
public function show(Request $request, Category $category, ?Carbon $start = null, ?Carbon $end = null)
|
||||
{
|
||||
// @var Carbon $start
|
||||
$start ??= session('start', today(config('app.timezone'))->startOfMonth());
|
||||
|
||||
@@ -38,7 +38,7 @@ class IntroController extends Controller
|
||||
/**
|
||||
* Returns the introduction wizard for a page.
|
||||
*/
|
||||
public function getIntroSteps(string $route, string $specificPage = null): JsonResponse
|
||||
public function getIntroSteps(string $route, ?string $specificPage = null): JsonResponse
|
||||
{
|
||||
app('log')->debug(sprintf('getIntroSteps for route "%s" and page "%s"', $route, $specificPage));
|
||||
$specificPage ??= '';
|
||||
@@ -91,7 +91,7 @@ class IntroController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function postEnable(string $route, string $specialPage = null): JsonResponse
|
||||
public function postEnable(string $route, ?string $specialPage = null): JsonResponse
|
||||
{
|
||||
$specialPage ??= '';
|
||||
$route = str_replace('.', '_', $route);
|
||||
@@ -111,7 +111,7 @@ class IntroController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function postFinished(string $route, string $specialPage = null): JsonResponse
|
||||
public function postFinished(string $route, ?string $specialPage = null): JsonResponse
|
||||
{
|
||||
$specialPage ??= '';
|
||||
$key = 'shown_demo_'.$route;
|
||||
|
||||
@@ -67,7 +67,7 @@ class ReconcileController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function overview(Request $request, Account $account = null, Carbon $start = null, Carbon $end = null): JsonResponse
|
||||
public function overview(Request $request, ?Account $account = null, ?Carbon $start = null, ?Carbon $end = null): JsonResponse
|
||||
{
|
||||
$startBalance = $request->get('startBalance');
|
||||
$endBalance = $request->get('endBalance');
|
||||
@@ -177,7 +177,7 @@ class ReconcileController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function transactions(Account $account, Carbon $start = null, Carbon $end = null)
|
||||
public function transactions(Account $account, ?Carbon $start = null, ?Carbon $end = null)
|
||||
{
|
||||
if (null === $start || null === $end) {
|
||||
throw new FireflyException('Invalid dates submitted.');
|
||||
|
||||
@@ -76,7 +76,7 @@ class CreateController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function create(Request $request, RuleGroup $ruleGroup = null)
|
||||
public function create(Request $request, ?RuleGroup $ruleGroup = null)
|
||||
{
|
||||
$this->createDefaultRuleGroup();
|
||||
$preFilled = [
|
||||
|
||||
@@ -215,7 +215,7 @@ class TagController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function show(Request $request, Tag $tag, Carbon $start = null, Carbon $end = null)
|
||||
public function show(Request $request, Tag $tag, ?Carbon $start = null, ?Carbon $end = null)
|
||||
{
|
||||
// default values:
|
||||
$subTitleIcon = 'fa-tag';
|
||||
|
||||
@@ -69,7 +69,7 @@ class IndexController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function index(Request $request, string $objectType, Carbon $start = null, Carbon $end = null)
|
||||
public function index(Request $request, string $objectType, ?Carbon $start = null, ?Carbon $end = null)
|
||||
{
|
||||
if ('transfers' === $objectType) {
|
||||
$objectType = 'transfer';
|
||||
|
||||
@@ -34,10 +34,10 @@ class TrustProxies extends Middleware
|
||||
// After...
|
||||
protected $headers
|
||||
= Request::HEADER_X_FORWARDED_FOR |
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
|
||||
/**
|
||||
* TrustProxies constructor.
|
||||
|
||||
@@ -122,13 +122,13 @@ class Account extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'user_id' => 'integer',
|
||||
'deleted_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'encrypted' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'user_id' => 'integer',
|
||||
'deleted_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'encrypted' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = ['user_id', 'user_group_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban'];
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ class AccountMeta extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
|
||||
protected $fillable = ['account_id', 'name', 'data'];
|
||||
|
||||
|
||||
@@ -72,9 +72,9 @@ class AccountType extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
|
||||
protected $fillable = ['type'];
|
||||
|
||||
|
||||
@@ -97,11 +97,11 @@ class Attachment extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'uploaded' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'uploaded' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = ['attachable_id', 'attachable_type', 'user_id', 'md5', 'filename', 'mime', 'title', 'description', 'size', 'uploaded'];
|
||||
|
||||
|
||||
@@ -80,13 +80,13 @@ class AvailableBudget extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'transaction_currency_id' => 'int',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'transaction_currency_id' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = ['user_id', 'user_group_id', 'transaction_currency_id', 'amount', 'start_date', 'end_date'];
|
||||
|
||||
|
||||
@@ -114,36 +114,36 @@ class Bill extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'extension_date' => 'date',
|
||||
'skip' => 'int',
|
||||
'automatch' => 'boolean',
|
||||
'active' => 'boolean',
|
||||
'name_encrypted' => 'boolean',
|
||||
'match_encrypted' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'extension_date' => 'date',
|
||||
'skip' => 'int',
|
||||
'automatch' => 'boolean',
|
||||
'active' => 'boolean',
|
||||
'name_encrypted' => 'boolean',
|
||||
'match_encrypted' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable
|
||||
= [
|
||||
'name',
|
||||
'match',
|
||||
'amount_min',
|
||||
'user_id',
|
||||
'user_group_id',
|
||||
'amount_max',
|
||||
'date',
|
||||
'repeat_freq',
|
||||
'skip',
|
||||
'automatch',
|
||||
'active',
|
||||
'transaction_currency_id',
|
||||
'end_date',
|
||||
'extension_date',
|
||||
];
|
||||
'name',
|
||||
'match',
|
||||
'amount_min',
|
||||
'user_id',
|
||||
'user_group_id',
|
||||
'amount_max',
|
||||
'date',
|
||||
'repeat_freq',
|
||||
'skip',
|
||||
'automatch',
|
||||
'active',
|
||||
'transaction_currency_id',
|
||||
'end_date',
|
||||
'extension_date',
|
||||
];
|
||||
|
||||
protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted'];
|
||||
|
||||
|
||||
@@ -97,12 +97,12 @@ class Budget extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'encrypted' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'encrypted' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = ['user_id', 'name', 'active', 'order', 'user_group_id'];
|
||||
|
||||
|
||||
@@ -74,18 +74,18 @@ class BudgetLimit extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'auto_budget' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'auto_budget' => 'boolean',
|
||||
];
|
||||
protected $dispatchesEvents
|
||||
= [
|
||||
'created' => Created::class,
|
||||
'updated' => Updated::class,
|
||||
'deleted' => Deleted::class,
|
||||
];
|
||||
'created' => Created::class,
|
||||
'updated' => Updated::class,
|
||||
'deleted' => Deleted::class,
|
||||
];
|
||||
|
||||
protected $fillable = ['budget_id', 'start_date', 'end_date', 'amount', 'transaction_currency_id'];
|
||||
|
||||
|
||||
@@ -86,11 +86,11 @@ class Category extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'encrypted' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'encrypted' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = ['user_id', 'user_group_id', 'name'];
|
||||
|
||||
|
||||
@@ -62,10 +62,10 @@ class Configuration extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/** @var string The table to store the data in */
|
||||
protected $table = 'configuration';
|
||||
|
||||
@@ -82,13 +82,13 @@ class CurrencyExchangeRate extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'user_id' => 'int',
|
||||
'from_currency_id' => 'int',
|
||||
'to_currency_id' => 'int',
|
||||
'date' => 'datetime',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'user_id' => 'int',
|
||||
'from_currency_id' => 'int',
|
||||
'to_currency_id' => 'int',
|
||||
'date' => 'datetime',
|
||||
];
|
||||
protected $fillable = ['user_id', 'from_currency_id', 'to_currency_id', 'date', 'rate'];
|
||||
|
||||
public function fromCurrency(): BelongsTo
|
||||
|
||||
@@ -70,9 +70,9 @@ class InvitedUser extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'expires' => 'datetime',
|
||||
'redeemed' => 'boolean',
|
||||
];
|
||||
'expires' => 'datetime',
|
||||
'redeemed' => 'boolean',
|
||||
];
|
||||
protected $fillable = ['user_id', 'email', 'invite_code', 'expires', 'redeemed'];
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,11 +72,11 @@ class LinkType extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'editable' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'editable' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = ['name', 'inward', 'outward', 'editable'];
|
||||
|
||||
|
||||
@@ -74,13 +74,13 @@ class Location extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'zoomLevel' => 'int',
|
||||
'latitude' => 'float',
|
||||
'longitude' => 'float',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'zoomLevel' => 'int',
|
||||
'latitude' => 'float',
|
||||
'longitude' => 'float',
|
||||
];
|
||||
|
||||
protected $fillable = ['locatable_id', 'locatable_type', 'latitude', 'longitude', 'zoom_level'];
|
||||
|
||||
|
||||
@@ -69,10 +69,10 @@ class Note extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
protected $fillable = ['title', 'text', 'noteable_id', 'noteable_type'];
|
||||
|
||||
|
||||
@@ -79,11 +79,11 @@ class ObjectGroup extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'user_id' => 'integer',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'user_id' => 'integer',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
protected $fillable = ['title', 'order', 'user_id', 'user_group_id'];
|
||||
|
||||
/**
|
||||
|
||||
@@ -92,15 +92,15 @@ class PiggyBank extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'startdate' => 'date',
|
||||
'targetdate' => 'date',
|
||||
'order' => 'int',
|
||||
'active' => 'boolean',
|
||||
'encrypted' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'startdate' => 'date',
|
||||
'targetdate' => 'date',
|
||||
'order' => 'int',
|
||||
'active' => 'boolean',
|
||||
'encrypted' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = ['name', 'account_id', 'order', 'targetamount', 'startdate', 'targetdate', 'active'];
|
||||
|
||||
|
||||
@@ -63,10 +63,10 @@ class PiggyBankEvent extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'date' => 'date',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'date' => 'date',
|
||||
];
|
||||
|
||||
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount'];
|
||||
|
||||
|
||||
@@ -64,11 +64,11 @@ class PiggyBankRepetition extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'startdate' => 'date',
|
||||
'targetdate' => 'date',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'startdate' => 'date',
|
||||
'targetdate' => 'date',
|
||||
];
|
||||
|
||||
protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount'];
|
||||
|
||||
|
||||
@@ -63,10 +63,10 @@ class Preference extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'data' => 'array',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'data' => 'array',
|
||||
];
|
||||
|
||||
protected $fillable = ['user_id', 'data', 'name'];
|
||||
|
||||
|
||||
@@ -104,19 +104,19 @@ class Recurrence extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'title' => 'string',
|
||||
'id' => 'int',
|
||||
'description' => 'string',
|
||||
'first_date' => 'date',
|
||||
'repeat_until' => 'date',
|
||||
'latest_date' => 'date',
|
||||
'repetitions' => 'int',
|
||||
'active' => 'bool',
|
||||
'apply_rules' => 'bool',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'title' => 'string',
|
||||
'id' => 'int',
|
||||
'description' => 'string',
|
||||
'first_date' => 'date',
|
||||
'repeat_until' => 'date',
|
||||
'latest_date' => 'date',
|
||||
'repetitions' => 'int',
|
||||
'active' => 'bool',
|
||||
'apply_rules' => 'bool',
|
||||
];
|
||||
|
||||
protected $fillable
|
||||
= ['user_id', 'transaction_type_id', 'title', 'description', 'first_date', 'repeat_until', 'latest_date', 'repetitions', 'apply_rules', 'active'];
|
||||
|
||||
@@ -67,12 +67,12 @@ class RecurrenceMeta extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'name' => 'string',
|
||||
'value' => 'string',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'name' => 'string',
|
||||
'value' => 'string',
|
||||
];
|
||||
|
||||
protected $fillable = ['recurrence_id', 'name', 'value'];
|
||||
|
||||
|
||||
@@ -76,14 +76,14 @@ class RecurrenceRepetition extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'repetition_type' => 'string',
|
||||
'repetition_moment' => 'string',
|
||||
'repetition_skip' => 'int',
|
||||
'weekend' => 'int',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'repetition_type' => 'string',
|
||||
'repetition_moment' => 'string',
|
||||
'repetition_skip' => 'int',
|
||||
'weekend' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = ['recurrence_id', 'weekend', 'repetition_type', 'repetition_moment', 'repetition_skip'];
|
||||
|
||||
|
||||
@@ -91,25 +91,25 @@ class RecurrenceTransaction extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'amount' => 'string',
|
||||
'foreign_amount' => 'string',
|
||||
'description' => 'string',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'amount' => 'string',
|
||||
'foreign_amount' => 'string',
|
||||
'description' => 'string',
|
||||
];
|
||||
|
||||
protected $fillable
|
||||
= [
|
||||
'recurrence_id',
|
||||
'transaction_currency_id',
|
||||
'foreign_currency_id',
|
||||
'source_id',
|
||||
'destination_id',
|
||||
'amount',
|
||||
'foreign_amount',
|
||||
'description',
|
||||
];
|
||||
'recurrence_id',
|
||||
'transaction_currency_id',
|
||||
'foreign_currency_id',
|
||||
'source_id',
|
||||
'destination_id',
|
||||
'amount',
|
||||
'foreign_amount',
|
||||
'description',
|
||||
];
|
||||
|
||||
/** @var string The table to store the data in */
|
||||
protected $table = 'recurrences_transactions';
|
||||
|
||||
@@ -67,12 +67,12 @@ class RecurrenceTransactionMeta extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'name' => 'string',
|
||||
'value' => 'string',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'name' => 'string',
|
||||
'value' => 'string',
|
||||
];
|
||||
|
||||
protected $fillable = ['rt_id', 'name', 'value'];
|
||||
|
||||
|
||||
@@ -62,9 +62,9 @@ class Role extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
|
||||
protected $fillable = ['name', 'display_name', 'description'];
|
||||
|
||||
|
||||
@@ -95,15 +95,15 @@ class Rule extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'order' => 'int',
|
||||
'stop_processing' => 'boolean',
|
||||
'id' => 'int',
|
||||
'strict' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'order' => 'int',
|
||||
'stop_processing' => 'boolean',
|
||||
'id' => 'int',
|
||||
'strict' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = ['rule_group_id', 'order', 'active', 'title', 'description', 'user_id', 'strict'];
|
||||
|
||||
|
||||
@@ -69,12 +69,12 @@ class RuleAction extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'order' => 'int',
|
||||
'stop_processing' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'order' => 'int',
|
||||
'stop_processing' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = ['rule_id', 'action_type', 'action_value', 'order', 'active', 'stop_processing'];
|
||||
|
||||
|
||||
@@ -85,13 +85,13 @@ class RuleGroup extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'stop_processing' => 'boolean',
|
||||
'order' => 'int',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'stop_processing' => 'boolean',
|
||||
'order' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = ['user_id', 'user_group_id', 'stop_processing', 'order', 'title', 'description', 'active'];
|
||||
|
||||
|
||||
@@ -66,12 +66,12 @@ class RuleTrigger extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'order' => 'int',
|
||||
'stop_processing' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'active' => 'boolean',
|
||||
'order' => 'int',
|
||||
'stop_processing' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = ['rule_id', 'trigger_type', 'trigger_value', 'order', 'active', 'stop_processing'];
|
||||
|
||||
|
||||
@@ -93,14 +93,14 @@ class Tag extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'date' => 'date',
|
||||
'zoomLevel' => 'int',
|
||||
'latitude' => 'float',
|
||||
'longitude' => 'float',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'date' => 'date',
|
||||
'zoomLevel' => 'int',
|
||||
'latitude' => 'float',
|
||||
'longitude' => 'float',
|
||||
];
|
||||
|
||||
protected $fillable = ['user_id', 'user_group_id', 'tag', 'date', 'description', 'tagMode'];
|
||||
|
||||
|
||||
@@ -99,28 +99,28 @@ class Transaction extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'identifier' => 'int',
|
||||
'encrypted' => 'boolean', // model does not have these fields though
|
||||
'bill_name_encrypted' => 'boolean',
|
||||
'reconciled' => 'boolean',
|
||||
'date' => 'datetime',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'identifier' => 'int',
|
||||
'encrypted' => 'boolean', // model does not have these fields though
|
||||
'bill_name_encrypted' => 'boolean',
|
||||
'reconciled' => 'boolean',
|
||||
'date' => 'datetime',
|
||||
];
|
||||
|
||||
protected $fillable
|
||||
= [
|
||||
'account_id',
|
||||
'transaction_journal_id',
|
||||
'description',
|
||||
'amount',
|
||||
'identifier',
|
||||
'transaction_currency_id',
|
||||
'foreign_currency_id',
|
||||
'foreign_amount',
|
||||
'reconciled',
|
||||
];
|
||||
'account_id',
|
||||
'transaction_journal_id',
|
||||
'description',
|
||||
'amount',
|
||||
'identifier',
|
||||
'transaction_currency_id',
|
||||
'foreign_currency_id',
|
||||
'foreign_amount',
|
||||
'reconciled',
|
||||
];
|
||||
|
||||
protected $hidden = ['encrypted'];
|
||||
|
||||
|
||||
@@ -89,12 +89,12 @@ class TransactionCurrency extends Model
|
||||
public ?bool $userGroupEnabled;
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'decimal_places' => 'int',
|
||||
'enabled' => 'bool',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'decimal_places' => 'int',
|
||||
'enabled' => 'bool',
|
||||
];
|
||||
|
||||
protected $fillable = ['name', 'code', 'symbol', 'decimal_places', 'enabled'];
|
||||
|
||||
|
||||
@@ -78,13 +78,13 @@ class TransactionGroup extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'id' => 'integer',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'title' => 'string',
|
||||
'date' => 'datetime',
|
||||
];
|
||||
'id' => 'integer',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'title' => 'string',
|
||||
'date' => 'datetime',
|
||||
];
|
||||
|
||||
protected $fillable = ['user_id', 'user_group_id', 'title'];
|
||||
|
||||
|
||||
@@ -138,32 +138,32 @@ class TransactionJournal extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'date' => 'datetime',
|
||||
'interest_date' => 'date',
|
||||
'book_date' => 'date',
|
||||
'process_date' => 'date',
|
||||
'order' => 'int',
|
||||
'tag_count' => 'int',
|
||||
'encrypted' => 'boolean',
|
||||
'completed' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'date' => 'datetime',
|
||||
'interest_date' => 'date',
|
||||
'book_date' => 'date',
|
||||
'process_date' => 'date',
|
||||
'order' => 'int',
|
||||
'tag_count' => 'int',
|
||||
'encrypted' => 'boolean',
|
||||
'completed' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable
|
||||
= [
|
||||
'user_id',
|
||||
'user_group_id',
|
||||
'transaction_type_id',
|
||||
'bill_id',
|
||||
'tag_count',
|
||||
'transaction_currency_id',
|
||||
'description',
|
||||
'completed',
|
||||
'order',
|
||||
'date',
|
||||
];
|
||||
'user_id',
|
||||
'user_group_id',
|
||||
'transaction_type_id',
|
||||
'bill_id',
|
||||
'tag_count',
|
||||
'transaction_currency_id',
|
||||
'description',
|
||||
'completed',
|
||||
'order',
|
||||
'date',
|
||||
];
|
||||
|
||||
protected $hidden = ['encrypted'];
|
||||
|
||||
|
||||
@@ -71,9 +71,9 @@ class TransactionJournalLink extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
|
||||
/** @var string The table to store the data in */
|
||||
protected $table = 'journal_links';
|
||||
|
||||
@@ -69,10 +69,10 @@ class TransactionJournalMeta extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
protected $fillable = ['transaction_journal_id', 'name', 'data', 'hash'];
|
||||
|
||||
|
||||
@@ -73,10 +73,10 @@ class TransactionType extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
protected $fillable = ['type'];
|
||||
|
||||
/**
|
||||
|
||||
@@ -93,11 +93,11 @@ class Webhook extends Model
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'active' => 'boolean',
|
||||
'trigger' => 'integer',
|
||||
'response' => 'integer',
|
||||
'delivery' => 'integer',
|
||||
];
|
||||
'active' => 'boolean',
|
||||
'trigger' => 'integer',
|
||||
'response' => 'integer',
|
||||
'delivery' => 'integer',
|
||||
];
|
||||
protected $fillable = ['active', 'trigger', 'response', 'delivery', 'user_id', 'user_group_id', 'url', 'title', 'secret'];
|
||||
|
||||
public static function getDeliveries(): array
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Repositories\LinkType\LinkTypeRepository;
|
||||
use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface;
|
||||
use Illuminate\Contracts\Support\DeferrableProvider;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
|
||||
$budgetLimit->delete();
|
||||
}
|
||||
|
||||
public function getAllBudgetLimitsByCurrency(TransactionCurrency $currency, Carbon $start = null, Carbon $end = null): Collection
|
||||
public function getAllBudgetLimitsByCurrency(TransactionCurrency $currency, ?Carbon $start = null, ?Carbon $end = null): Collection
|
||||
{
|
||||
return $this->getAllBudgetLimits($start, $end)->filter(
|
||||
static function (BudgetLimit $budgetLimit) use ($currency) {
|
||||
@@ -131,7 +131,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
|
||||
);
|
||||
}
|
||||
|
||||
public function getAllBudgetLimits(Carbon $start = null, Carbon $end = null): Collection
|
||||
public function getAllBudgetLimits(?Carbon $start = null, ?Carbon $end = null): Collection
|
||||
{
|
||||
// both are NULL:
|
||||
if (null === $start && null === $end) {
|
||||
@@ -198,7 +198,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
|
||||
;
|
||||
}
|
||||
|
||||
public function getBudgetLimits(Budget $budget, Carbon $start = null, Carbon $end = null): Collection
|
||||
public function getBudgetLimits(Budget $budget, ?Carbon $start = null, ?Carbon $end = null): Collection
|
||||
{
|
||||
if (null === $end && null === $start) {
|
||||
return $budget->budgetlimits()->with(['transactionCurrency'])->orderBy('budget_limits.start_date', 'DESC')->get(['budget_limits.*']);
|
||||
|
||||
@@ -57,11 +57,11 @@ interface BudgetLimitRepositoryInterface
|
||||
/**
|
||||
* TODO this method is not multi currency aware.
|
||||
*/
|
||||
public function getAllBudgetLimits(Carbon $start = null, Carbon $end = null): Collection;
|
||||
public function getAllBudgetLimits(?Carbon $start = null, ?Carbon $end = null): Collection;
|
||||
|
||||
public function getAllBudgetLimitsByCurrency(TransactionCurrency $currency, Carbon $start = null, Carbon $end = null): Collection;
|
||||
public function getAllBudgetLimitsByCurrency(TransactionCurrency $currency, ?Carbon $start = null, ?Carbon $end = null): Collection;
|
||||
|
||||
public function getBudgetLimits(Budget $budget, Carbon $start = null, Carbon $end = null): Collection;
|
||||
public function getBudgetLimits(Budget $budget, ?Carbon $start = null, ?Carbon $end = null): Collection;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
|
||||
@@ -438,7 +438,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
*
|
||||
* @param null|int $budgetId |null
|
||||
*/
|
||||
public function find(int $budgetId = null): ?Budget
|
||||
public function find(?int $budgetId = null): ?Budget
|
||||
{
|
||||
return $this->user->budgets()->find($budgetId);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ interface BudgetRepositoryInterface
|
||||
|
||||
public function destroyAutoBudget(Budget $budget): void;
|
||||
|
||||
public function find(int $budgetId = null): ?Budget;
|
||||
public function find(?int $budgetId = null): ?Budget;
|
||||
|
||||
public function findBudget(?int $budgetId, ?string $budgetName): ?Budget;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
|
||||
return $linkType->transactionJournalLinks()->count();
|
||||
}
|
||||
|
||||
public function destroy(LinkType $linkType, LinkType $moveTo = null): bool
|
||||
public function destroy(LinkType $linkType, ?LinkType $moveTo = null): bool
|
||||
{
|
||||
if (null !== $moveTo) {
|
||||
TransactionJournalLink::where('link_type_id', $linkType->id)->update(['link_type_id' => $moveTo->id]);
|
||||
@@ -113,7 +113,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
|
||||
/**
|
||||
* Returns all the journal links (of a specific type).
|
||||
*/
|
||||
public function getJournalLinks(LinkType $linkType = null): Collection
|
||||
public function getJournalLinks(?LinkType $linkType = null): Collection
|
||||
{
|
||||
$query = TransactionJournalLink::with(['source', 'destination'])
|
||||
->leftJoin('transaction_journals as source_journals', 'journal_links.source_id', '=', 'source_journals.id')
|
||||
@@ -225,7 +225,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
|
||||
return LinkType::find($linkTypeId);
|
||||
}
|
||||
|
||||
public function findByName(string $name = null): ?LinkType
|
||||
public function findByName(?string $name = null): ?LinkType
|
||||
{
|
||||
if (null === $name) {
|
||||
return null;
|
||||
|
||||
@@ -37,7 +37,7 @@ interface LinkTypeRepositoryInterface
|
||||
{
|
||||
public function countJournals(LinkType $linkType): int;
|
||||
|
||||
public function destroy(LinkType $linkType, LinkType $moveTo = null): bool;
|
||||
public function destroy(LinkType $linkType, ?LinkType $moveTo = null): bool;
|
||||
|
||||
public function destroyLink(TransactionJournalLink $link): bool;
|
||||
|
||||
@@ -46,7 +46,7 @@ interface LinkTypeRepositoryInterface
|
||||
/**
|
||||
* Find link type by name.
|
||||
*/
|
||||
public function findByName(string $name = null): ?LinkType;
|
||||
public function findByName(?string $name = null): ?LinkType;
|
||||
|
||||
/**
|
||||
* Check if link exists between journals.
|
||||
@@ -65,7 +65,7 @@ interface LinkTypeRepositoryInterface
|
||||
*/
|
||||
public function getJournalIds(LinkType $linkType): array;
|
||||
|
||||
public function getJournalLinks(LinkType $linkType = null): Collection;
|
||||
public function getJournalLinks(?LinkType $linkType = null): Collection;
|
||||
|
||||
/**
|
||||
* Return list of existing connections.
|
||||
|
||||
@@ -202,7 +202,7 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
/**
|
||||
* Returns the journals created for this recurrence, possibly limited by time.
|
||||
*/
|
||||
public function getJournalCount(Recurrence $recurrence, Carbon $start = null, Carbon $end = null): int
|
||||
public function getJournalCount(Recurrence $recurrence, ?Carbon $start = null, ?Carbon $end = null): int
|
||||
{
|
||||
$query = TransactionJournal::leftJoin('journal_meta', 'journal_meta.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->where('transaction_journals.user_id', $recurrence->user_id)
|
||||
|
||||
@@ -83,7 +83,7 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Returns the count of journals created for this recurrence, possibly limited by time.
|
||||
*/
|
||||
public function getJournalCount(Recurrence $recurrence, Carbon $start = null, Carbon $end = null): int;
|
||||
public function getJournalCount(Recurrence $recurrence, ?Carbon $start = null, ?Carbon $end = null): int;
|
||||
|
||||
/**
|
||||
* Get journal ID's for journals created by this recurring transaction.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -187,10 +187,10 @@ class User extends Authenticatable
|
||||
|
||||
protected $casts
|
||||
= [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'blocked' => 'boolean',
|
||||
];
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'blocked' => 'boolean',
|
||||
];
|
||||
protected $fillable = ['email', 'password', 'blocked', 'blocked_code'];
|
||||
protected $hidden = ['password', 'remember_token'];
|
||||
protected $table = 'users';
|
||||
|
||||
@@ -253,7 +253,7 @@ class FireflyValidator extends Validator
|
||||
return 1 === $count;
|
||||
}
|
||||
|
||||
public function validateRuleActionValue(string $attribute, string $value = null): bool
|
||||
public function validateRuleActionValue(string $attribute, ?string $value = null): bool
|
||||
{
|
||||
// first, get the index from this string:
|
||||
$value ??= '';
|
||||
@@ -324,7 +324,7 @@ class FireflyValidator extends Validator
|
||||
/**
|
||||
* $attribute has the format triggers.%d.value.
|
||||
*/
|
||||
public function validateRuleTriggerValue(string $attribute, string $value = null): bool
|
||||
public function validateRuleTriggerValue(string $attribute, ?string $value = null): bool
|
||||
{
|
||||
// first, get the index from this string:
|
||||
$parts = explode('.', $attribute);
|
||||
|
||||
@@ -45,7 +45,7 @@ trait TransactionValidation
|
||||
*
|
||||
* Inclusion of user and/or group is optional.
|
||||
*/
|
||||
public function validateAccountInformation(Validator $validator, User $user = null, UserGroup $userGroup = null): void
|
||||
public function validateAccountInformation(Validator $validator, ?User $user = null, ?UserGroup $userGroup = null): void
|
||||
{
|
||||
if ($validator->errors()->count() > 0) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user