Reformat various code.

This commit is contained in:
James Cole 2022-03-29 15:01:48 +02:00
parent 452b6d0e1b
commit 60786461a9
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
7 changed files with 539 additions and 97 deletions

View File

@ -23,45 +23,45 @@
declare(strict_types=1);
return [
'html_language' => 'en',
'locale' => 'en, English, en_US.utf8, en_US.UTF-8',
'html_language' => 'en',
'locale' => 'en, English, en_US.utf8, en_US.UTF-8',
//'month' => '%B %Y',
'month_js' => 'MMMM YYYY',
'month_js' => 'MMMM YYYY',
//'month_and_day' => '%B %e, %Y',
'month_and_day_moment_js' => 'MMM D, YYYY',
'month_and_day_fns' => 'MMMM d, y',
'month_and_day_js' => 'MMMM Do, YYYY',
'month_and_day_moment_js' => 'MMM D, YYYY',
'month_and_day_fns' => 'MMMM d, y',
'month_and_day_js' => 'MMMM Do, YYYY',
//'month_and_date_day' => '%A %B %e, %Y',
'month_and_date_day_js' => 'dddd MMMM Do, YYYY',
'month_and_date_day_js' => 'dddd MMMM Do, YYYY',
//'month_and_day_no_year' => '%B %e',
'month_and_day_no_year_js' => 'MMMM Do',
//'date_time' => '%B %e, %Y, @ %T',
'date_time_js' => 'MMMM Do, YYYY, @ HH:mm:ss',
'date_time_js' => 'MMMM Do, YYYY, @ HH:mm:ss',
//'specific_day' => '%e %B %Y',
'specific_day_js' => 'D MMMM YYYY',
'specific_day_js' => 'D MMMM YYYY',
//'week_in_year' => 'Week %V, %G',
'week_in_year_js' => '[Week] w, YYYY',
'week_in_year_fns' => "'Week' w, yyyy",
'week_in_year_js' => '[Week] w, YYYY',
'week_in_year_fns' => "'Week' w, yyyy",
//'year' => '%Y',
'year_js' => 'YYYY',
'year_js' => 'YYYY',
//'half_year' => '%B %Y',
'half_year_js' => 'Q YYYY',
'half_year_js' => 'Q YYYY',
'quarter_fns' => "'Q'Q, yyyy",
'half_year_fns' => "'H{half}', yyyy",
'dow_1' => 'Monday',
'dow_2' => 'Tuesday',
'dow_3' => 'Wednesday',
'dow_4' => 'Thursday',
'dow_5' => 'Friday',
'dow_6' => 'Saturday',
'dow_7' => 'Sunday',
'quarter_fns' => "'Q'Q, yyyy",
'half_year_fns' => "'H{half}', yyyy",
'dow_1' => 'Monday',
'dow_2' => 'Tuesday',
'dow_3' => 'Wednesday',
'dow_4' => 'Thursday',
'dow_5' => 'Friday',
'dow_6' => 'Saturday',
'dow_7' => 'Sunday',
];

View File

@ -24,46 +24,46 @@ declare(strict_types=1);
return [
// index
'index_intro' => 'Welcome to the index page of Firefly III. Please take the time to walk through this intro to get a feeling of how Firefly III works.',
'index_accounts-chart' => 'This chart shows the current balance of your asset accounts. You can select the accounts visible here in your preferences.',
'index_box_out_holder' => 'This little box and the boxes next to this one will give you a quick overview of your financial situation.',
'index_help' => 'If you ever need help with a page or a form, press this button.',
'index_outro' => 'Most pages of Firefly III will start with a little tour like this one. Please contact me when you have questions or comments. Enjoy!',
'index_sidebar-toggle' => 'To create new transactions, accounts or other things, use the menu under this icon.',
'index_cash_account' => 'These are the accounts created so far. You can use the cash account to track cash expenses but it\'s not mandatory of course.',
'index_intro' => 'Welcome to the index page of Firefly III. Please take the time to walk through this intro to get a feeling of how Firefly III works.',
'index_accounts-chart' => 'This chart shows the current balance of your asset accounts. You can select the accounts visible here in your preferences.',
'index_box_out_holder' => 'This little box and the boxes next to this one will give you a quick overview of your financial situation.',
'index_help' => 'If you ever need help with a page or a form, press this button.',
'index_outro' => 'Most pages of Firefly III will start with a little tour like this one. Please contact me when you have questions or comments. Enjoy!',
'index_sidebar-toggle' => 'To create new transactions, accounts or other things, use the menu under this icon.',
'index_cash_account' => 'These are the accounts created so far. You can use the cash account to track cash expenses but it\'s not mandatory of course.',
// transactions
'transactions_create_basic_info' => 'Enter the basic information of your transaction. Source, destination, date and description.',
'transactions_create_amount_info' => 'Enter the amount of the transaction. If necessary the fields will auto-update for foreign amount info.',
'transactions_create_optional_info' => 'All of these fields are optional. Adding meta-data here will make your transactions better organised.',
'transactions_create_split' => 'If you want to split a transaction, add more splits with this button',
'transactions_create_basic_info' => 'Enter the basic information of your transaction. Source, destination, date and description.',
'transactions_create_amount_info' => 'Enter the amount of the transaction. If necessary the fields will auto-update for foreign amount info.',
'transactions_create_optional_info' => 'All of these fields are optional. Adding meta-data here will make your transactions better organised.',
'transactions_create_split' => 'If you want to split a transaction, add more splits with this button',
// create account:
'accounts_create_iban' => 'Give your accounts a valid IBAN. This could make a data import very easy in the future.',
'accounts_create_asset_opening_balance' => 'Assets accounts may have an "opening balance", indicating the start of this account\'s history in Firefly III.',
'accounts_create_asset_currency' => 'Firefly III supports multiple currencies. Asset accounts have one main currency, which you must set here.',
'accounts_create_asset_virtual' => 'It can sometimes help to give your account a virtual balance: an extra amount always added to or removed from the actual balance.',
'accounts_create_iban' => 'Give your accounts a valid IBAN. This could make a data import very easy in the future.',
'accounts_create_asset_opening_balance' => 'Assets accounts may have an "opening balance", indicating the start of this account\'s history in Firefly III.',
'accounts_create_asset_currency' => 'Firefly III supports multiple currencies. Asset accounts have one main currency, which you must set here.',
'accounts_create_asset_virtual' => 'It can sometimes help to give your account a virtual balance: an extra amount always added to or removed from the actual balance.',
// budgets index
'budgets_index_intro' => 'Budgets are used to manage your finances and form one of the core functions of Firefly III.',
'budgets_index_set_budget' => 'Set your total budget for every period so Firefly III can tell you if you have budgeted all available money.',
'budgets_index_see_expenses_bar' => 'Spending money will slowly fill this bar.',
'budgets_index_navigate_periods' => 'Navigate through periods to easily set budgets ahead of time.',
'budgets_index_new_budget' => 'Create new budgets as you see fit.',
'budgets_index_list_of_budgets' => 'Use this table to set the amounts for each budget and see how you are doing.',
'budgets_index_outro' => 'To learn more about budgeting, checkout the help icon in the top right corner.',
'budgets_index_intro' => 'Budgets are used to manage your finances and form one of the core functions of Firefly III.',
'budgets_index_set_budget' => 'Set your total budget for every period so Firefly III can tell you if you have budgeted all available money.',
'budgets_index_see_expenses_bar' => 'Spending money will slowly fill this bar.',
'budgets_index_navigate_periods' => 'Navigate through periods to easily set budgets ahead of time.',
'budgets_index_new_budget' => 'Create new budgets as you see fit.',
'budgets_index_list_of_budgets' => 'Use this table to set the amounts for each budget and see how you are doing.',
'budgets_index_outro' => 'To learn more about budgeting, checkout the help icon in the top right corner.',
// reports (index)
'reports_index_intro' => 'Use these reports to get detailed insights in your finances.',
'reports_index_inputReportType' => 'Pick a report type. Check out the help pages to see what each report shows you.',
'reports_index_inputAccountsSelect' => 'You can exclude or include asset accounts as you see fit.',
'reports_index_inputDateRange' => 'The selected date range is entirely up to you: from one day to 10 years.',
'reports_index_extra-options-box' => 'Depending on the report you have selected, you can select extra filters and options here. Watch this box when you change report types.',
'reports_index_intro' => 'Use these reports to get detailed insights in your finances.',
'reports_index_inputReportType' => 'Pick a report type. Check out the help pages to see what each report shows you.',
'reports_index_inputAccountsSelect' => 'You can exclude or include asset accounts as you see fit.',
'reports_index_inputDateRange' => 'The selected date range is entirely up to you: from one day to 10 years.',
'reports_index_extra-options-box' => 'Depending on the report you have selected, you can select extra filters and options here. Watch this box when you change report types.',
// reports (reports)
'reports_report_default_intro' => 'This report will give you a quick and comprehensive overview of your finances. If you wish to see anything else, please don\'t hestitate to contact me!',
'reports_report_audit_intro' => 'This report will give you detailed insights in your asset accounts.',
'reports_report_audit_optionsBox' => 'Use these check boxes to show or hide the columns you are interested in.',
'reports_report_default_intro' => 'This report will give you a quick and comprehensive overview of your finances. If you wish to see anything else, please don\'t hestitate to contact me!',
'reports_report_audit_intro' => 'This report will give you detailed insights in your asset accounts.',
'reports_report_audit_optionsBox' => 'Use these check boxes to show or hide the columns you are interested in.',
'reports_report_category_intro' => 'This report will give you insight in one or multiple categories.',
'reports_report_category_pieCharts' => 'These charts will give you insight in expenses and income per category or per account.',

File diff suppressed because one or more lines are too long

View File

@ -24,8 +24,8 @@ declare(strict_types=1);
// Cron job API routes:
Route::group(
[
'namespace' => 'FireflyIII\Api\V1\Controllers\System', 'prefix' => '',
'as' => 'api.v1.cron.'],
'namespace' => 'FireflyIII\Api\V1\Controllers\System', 'prefix' => '',
'as' => 'api.v1.cron.'],
static function () {
Route::get('{cliToken}', ['uses' => 'CronController@cron', 'as' => 'index']);
}

View File

@ -21,7 +21,6 @@
*/
declare(strict_types=1);
use FireflyIII\Http\Middleware\IsAdmin;
/**
* Autocomplete controllers

View File

@ -54,10 +54,10 @@ if (!function_exists('limitStringLength')) {
function limitStringLength(string $string): string
{
$maxChars = 75;
$length = \strlen($string);
$length = strlen($string);
$result = $string;
if ($length > $maxChars) {
$result = substr_replace($string, ' ... ', (int)($maxChars / 2), $length - $maxChars);
$result = substr_replace($string, ' ... ', (int) ($maxChars / 2), $length - $maxChars);
}
return $result;
@ -114,8 +114,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
['start' => $start->isoFormat((string) trans('config.month_and_day_js')),
'end' => $end->isoFormat((string) trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('accounts.show', $account));
}
@ -443,8 +443,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
['start' => $start->isoFormat((string) trans('config.month_and_day_js')),
'end' => $end->isoFormat((string) trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('budgets.no-budget'));
}
@ -477,8 +477,8 @@ try {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $budgetLimit->start_date->isoFormat((string)trans('config.month_and_day_js')),
'end' => $budgetLimit->end_date->isoFormat((string)trans('config.month_and_day_js')),]
['start' => $budgetLimit->start_date->isoFormat((string) trans('config.month_and_day_js')),
'end' => $budgetLimit->end_date->isoFormat((string) trans('config.month_and_day_js')),]
);
$breadcrumbs->push(
@ -527,8 +527,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
['start' => $start->isoFormat((string) trans('config.month_and_day_js')),
'end' => $end->isoFormat((string) trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('categories.show', [$category->id]));
}
@ -552,8 +552,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
['start' => $start->isoFormat((string) trans('config.month_and_day_js')),
'end' => $end->isoFormat((string) trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('categories.no-category'));
}
@ -747,10 +747,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day_js');
$monthFormat = (string) trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_audit', ['start' => $startString, 'end' => $endString]);
$title = (string) trans('firefly.report_audit', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.audit', [$accountIds, $start->format('Ymd'), $end->format('Ymd')]));
}
@ -760,10 +760,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $budgetIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day_js');
$monthFormat = (string) trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_budget', ['start' => $startString, 'end' => $endString]);
$title = (string) trans('firefly.report_budget', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.budget', [$accountIds, $budgetIds, $start->format('Ymd'), $end->format('Ymd')]));
}
@ -774,10 +774,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $tagTags, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day_js');
$monthFormat = (string) trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_tag', ['start' => $startString, 'end' => $endString]);
$title = (string) trans('firefly.report_tag', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.tag', [$accountIds, $tagTags, $start->format('Ymd'), $end->format('Ymd')]));
}
@ -788,10 +788,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $categoryIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day_js');
$monthFormat = (string) trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_category', ['start' => $startString, 'end' => $endString]);
$title = (string) trans('firefly.report_category', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.category', [$accountIds, $categoryIds, $start->format('Ymd'), $end->format('Ymd')]));
}
@ -802,10 +802,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $doubleIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day_js');
$monthFormat = (string) trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_double', ['start' => $startString, 'end' => $endString]);
$title = (string) trans('firefly.report_double', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.double', [$accountIds, $doubleIds, $start->format('Ymd'), $end->format('Ymd')]));
}
@ -816,10 +816,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day_js');
$monthFormat = (string) trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_default', ['start' => $startString, 'end' => $endString]);
$title = (string) trans('firefly.report_default', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.default', [$accountIds, $start->format('Ymd'), $end->format('Ymd')]));
}
@ -1029,8 +1029,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
['start' => $start->isoFormat((string) trans('config.month_and_day_js')),
'end' => $end->isoFormat((string) trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('tags.show', [$tag->id, $start, $end]));
}
@ -1042,7 +1042,7 @@ try {
static function (Generator $breadcrumbs, Tag $tag) {
$breadcrumbs->parent('tags.index');
$breadcrumbs->push($tag->tag, route('tags.show', [$tag->id]));
$title = (string)trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]);
$title = (string) trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]);
$breadcrumbs->push($title, route('tags.show.all', $tag->id));
}
);
@ -1059,8 +1059,8 @@ try {
// add date range:
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
['start' => $start->isoFormat((string) trans('config.month_and_day_js')),
'end' => $end->isoFormat((string) trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('transactions.index', [$what, $start, $end]));
}
@ -1092,7 +1092,7 @@ try {
$first = $group->transactionJournals()->first();
$breadcrumbs->push(
trans('breadcrumbs.edit_journal', ['description' => limitStringLength((string)$first->description)]),
trans('breadcrumbs.edit_journal', ['description' => limitStringLength((string) $first->description)]),
route('transactions.edit', [$group->id])
);
}
@ -1131,7 +1131,7 @@ try {
$type = strtolower($first->transactionType->type);
$title = limitStringLength($first->description);
if ($group->transactionJournals()->count() > 1) {
$title = limitStringLength((string)$group->title);
$title = limitStringLength((string) $group->title);
}
if ('opening balance' === $type) {
// See reference nr. 1

View File

@ -38,9 +38,9 @@ Route::group(
);
Route::group(
['middleware' => 'binders-only', 'namespace' => 'FireflyIII\Http\Controllers\System'],
['middleware' => 'binders-only', 'namespace' => 'FireflyIII\Http\Controllers\System'],
static function () {
Route::get('offline', fn () => view('errors.offline'));
Route::get('offline', fn() => view('errors.offline'));
Route::get('health', ['uses' => 'HealthcheckController@check', 'as' => 'healthcheck']);
}
);
@ -52,7 +52,7 @@ Route::group(
['middleware' => 'user-not-logged-in', 'namespace' => 'FireflyIII\Http\Controllers'],
static function () {
// Authentication Routes...
// Authentication Routes...
Route::get('login', ['uses' => 'Auth\LoginController@showLoginForm', 'as' => 'login']);
Route::post('login', ['uses' => 'Auth\LoginController@login', 'as' => 'login.post']);
@ -234,7 +234,7 @@ Route::group(
['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'budgets', 'as' => 'budgets.'],
static function () {
// delete
// delete
Route::get('delete/{budget}', ['uses' => 'Budget\DeleteController@delete', 'as' => 'delete']);
Route::post('destroy/{budget}', ['uses' => 'Budget\DeleteController@destroy', 'as' => 'destroy']);
@ -305,7 +305,7 @@ Route::group(
['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'categories', 'as' => 'categories.'],
static function () {
// index:
// index:
Route::get('', ['uses' => 'Category\IndexController@index', 'as' => 'index']);
// create
@ -563,7 +563,7 @@ Route::group(
['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'export', 'as' => 'export.'],
static function () {
// index
// index
Route::get('', ['uses' => 'Export\IndexController@index', 'as' => 'index']);
Route::post('export', ['uses' => 'Export\IndexController@export', 'as' => 'export']);
}
@ -724,7 +724,7 @@ Route::group(
/**
* Recurring Transactions Controller.
*
*
*/
Route::group(
['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'recurring', 'as' => 'recurring.'],
@ -903,7 +903,7 @@ Route::group(
['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'rules', 'as' => 'rules.'],
static function () {
// create controller
// create controller
Route::get('create/{ruleGroup?}', ['uses' => 'Rule\CreateController@create', 'as' => 'create']);
Route::get('create-from-bill/{bill}', ['uses' => 'Rule\CreateController@createFromBill', 'as' => 'create-from-bill']);
Route::get('create-from-journal/{tj}', ['uses' => 'Rule\CreateController@createFromJournal', 'as' => 'create-from-journal']);
@ -992,7 +992,7 @@ Route::group(
['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'transactions', 'as' => 'transactions.'],
static function () {
// show groups:
// show groups:
// See reference nr. 5
Route::get('{what}/all', ['uses' => 'Transaction\IndexController@indexAll', 'as' => 'index.all'])->where(
['what' => 'withdrawal|deposit|transfers|transfer']
@ -1101,7 +1101,7 @@ Route::group(
['middleware' => 'admin', 'namespace' => 'FireflyIII\Http\Controllers\Admin', 'prefix' => 'admin', 'as' => 'admin.'],
static function () {
// admin home
// admin home
Route::get('', ['uses' => 'HomeController@index', 'as' => 'index']);
Route::post('test-message', ['uses' => 'HomeController@testMessage', 'as' => 'test-message']);