From c9d5d746621b5f3bac1c308d82923642026d72bc Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 20 Dec 2023 19:45:12 +0100 Subject: [PATCH] More code cleanup --- .ci/php-cs-fixer/.php-cs-fixer.php | 6 +- routes/api.php | 98 +--- routes/breadcrumbs.php | 24 +- routes/web.php | 525 +++++++++--------- .../Autocomplete/AccountControllerTest.php | 6 +- tests/integration/CreatesApplication.php | 3 +- .../Support/Models/BillDateCalculatorTest.php | 6 +- .../NavigationCustomEndOfPeriodTest.php | 8 +- tests/integration/TestCase.php | 3 - tests/integration/Traits/CollectsValues.php | 3 - .../Support/Calendar/CalculatorProvider.php | 4 +- .../unit/Support/Calendar/CalculatorTest.php | 35 +- .../Calendar/Periodicity/BimonthlyTest.php | 6 +- .../Calendar/Periodicity/DailyTest.php | 7 +- .../Calendar/Periodicity/FortnightlyTest.php | 7 +- .../Calendar/Periodicity/HalfYearlyTest.php | 7 +- .../Calendar/Periodicity/IntervalProvider.php | 1 - .../Calendar/Periodicity/IntervalTestCase.php | 6 +- .../Calendar/Periodicity/MonthlyTest.php | 9 +- .../Calendar/Periodicity/QuarterlyTest.php | 7 +- .../Calendar/Periodicity/WeeklyTest.php | 7 +- .../Calendar/Periodicity/YearlyTest.php | 7 +- .../unit/Support/NavigationAddPeriodTest.php | 7 +- .../Support/NavigationEndOfPeriodTest.php | 9 +- ...ationPreferredCarbonFormatByPeriodTest.php | 6 +- .../NavigationPreferredCarbonFormatTest.php | 6 +- .../NavigationPreferredEndOfPeriodTest.php | 6 +- .../NavigationPreferredRangeFormatTest.php | 6 +- .../NavigationPreferredSqlFormatTest.php | 6 +- .../Support/NavigationStartOfPeriodTest.php | 11 +- 30 files changed, 420 insertions(+), 422 deletions(-) diff --git a/.ci/php-cs-fixer/.php-cs-fixer.php b/.ci/php-cs-fixer/.php-cs-fixer.php index c37cc105e1..a996328555 100644 --- a/.ci/php-cs-fixer/.php-cs-fixer.php +++ b/.ci/php-cs-fixer/.php-cs-fixer.php @@ -25,9 +25,9 @@ $paths = [ $current . '/../../app', $current . '/../../config', $current . '/../../database', -// $current . '/../../routes', -// $current . '/../../tests', -// $current . '/../../resources/lang', + $current . '/../../routes', + $current . '/../../tests', + $current . '/../../resources/lang', ]; $finder = PhpCsFixer\Finder::create() diff --git a/routes/api.php b/routes/api.php index 8f0976282e..213c90d828 100644 --- a/routes/api.php +++ b/routes/api.php @@ -22,9 +22,7 @@ declare(strict_types=1); -/** - * V2 API route for Summary boxes - */ +// V2 API route for Summary boxes // BASIC Route::group( [ @@ -36,9 +34,7 @@ Route::group( Route::get('basic', ['uses' => 'BasicController@basic', 'as' => 'basic']); } ); -/** - * V2 API route for TransactionList API endpoints - */ +// V2 API route for TransactionList API endpoints Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\Transaction\List', @@ -51,9 +47,7 @@ Route::group( } ); -/** - * V2 API routes for auto complete - */ +// V2 API routes for auto complete Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\Autocomplete', @@ -67,9 +61,7 @@ Route::group( } ); -/** - * V2 API route for net worth endpoint(s); - */ +// V2 API route for net worth endpoint(s); Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\Summary', @@ -81,9 +73,7 @@ Route::group( } ); -/** - * V2 API routes for charts - */ +// V2 API routes for charts Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\Chart', @@ -98,9 +88,7 @@ Route::group( } ); -/** - * V2 API route for accounts. - */ +// V2 API route for accounts. Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\Model\Account', @@ -112,9 +100,7 @@ Route::group( } ); -/** - * V2 API route for subscriptions. - */ +// V2 API route for subscriptions. Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\Model\Bill', @@ -129,9 +115,7 @@ Route::group( } ); -/** - * V2 API route for piggy banks. - */ +// V2 API route for piggy banks. Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\Model\PiggyBank', @@ -143,9 +127,7 @@ Route::group( } ); -/** - * V2 API route for transaction currencies - */ +// V2 API route for transaction currencies Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\Model\Currency', @@ -157,9 +139,7 @@ Route::group( } ); -/** - * V2 API route for transactions - */ +// V2 API route for transactions Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\Model\Transaction', @@ -171,9 +151,7 @@ Route::group( } ); -/** - * V2 API route for budgets and budget limits: - */ +// V2 API route for budgets and budget limits: Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\Model', @@ -186,14 +164,12 @@ Route::group( Route::get('{budget}/limits', ['uses' => 'BudgetLimit\IndexController@index', 'as' => 'budget-limits.index']); Route::get('sum/budgeted', ['uses' => 'Budget\IndexController@budgeted', 'as' => 'sum.budgeted']); Route::get('sum/spent', ['uses' => 'Budget\IndexController@spent', 'as' => 'sum.spent']); - //Route::get('{budget}/budgeted', ['uses' => 'Budget\ShowController@budgeted', 'as' => 'budget.budgeted']); - //Route::get('{budget}/spent', ['uses' => 'Budget\ShowController@spent', 'as' => 'budget.spent']); + // Route::get('{budget}/budgeted', ['uses' => 'Budget\ShowController@budgeted', 'as' => 'budget.budgeted']); + // Route::get('{budget}/spent', ['uses' => 'Budget\ShowController@spent', 'as' => 'budget.spent']); } ); -/** - * V2 API route for system - */ +// V2 API route for system Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\System', @@ -205,9 +181,7 @@ Route::group( } ); -/** - * V2 API route for user groups (administrations). - */ +// V2 API route for user groups (administrations). Route::group( [ 'namespace' => 'FireflyIII\Api\V2\Controllers\UserGroup', @@ -226,9 +200,7 @@ Route::group( // down here is v1 -/** - * Autocomplete controllers - */ +// Autocomplete controllers Route::group( [ 'namespace' => 'FireflyIII\Api\V1\Controllers\Autocomplete', @@ -256,9 +228,7 @@ Route::group( } ); -/** - * CHART ROUTES. - */ +// CHART ROUTES. // Accounts Route::group( [ @@ -271,9 +241,7 @@ Route::group( } ); -/** - * DATA ROUTES - */ +// DATA ROUTES // Export data API routes Route::group( [ @@ -327,9 +295,7 @@ Route::group( } ); -/** - * INSIGHTS ROUTES - */ +// INSIGHTS ROUTES // Insight in expenses: Route::group( @@ -401,9 +367,7 @@ Route::group( // TODO Transfers for piggies } ); -/** - * SUMMARY CONTROLLER - */ +// SUMMARY CONTROLLER // BASIC Route::group( [ @@ -416,9 +380,7 @@ Route::group( } ); -/** - * MODELS - */ +// MODELS // Accounts API routes: Route::group( [ @@ -486,10 +448,10 @@ Route::group( ], static function () { Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); - //Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); + // Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); Route::get('{availableBudget}', ['uses' => 'ShowController@show', 'as' => 'show']); - //Route::put('{availableBudget}', ['uses' => 'UpdateController@update', 'as' => 'update']); - //Route::delete('{availableBudget}', ['uses' => 'DestroyController@destroy', 'as' => 'delete']); + // Route::put('{availableBudget}', ['uses' => 'UpdateController@update', 'as' => 'update']); + // Route::delete('{availableBudget}', ['uses' => 'DestroyController@destroy', 'as' => 'delete']); } ); @@ -763,9 +725,7 @@ Route::group( } ); -/** - * SEARCH ENDPOINTS - */ +// SEARCH ENDPOINTS Route::group( [ 'namespace' => 'FireflyIII\Api\V1\Controllers\Search', @@ -778,9 +738,7 @@ Route::group( } ); -/** - * SYSTEM END POINTS - */ +// SYSTEM END POINTS // About Firefly III API routes: Route::group( [ @@ -823,9 +781,7 @@ Route::group( } ); -/** - * USER - */ +// USER // Preference API routes: Route::group( diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php index 25652abd37..f6be8c699a 100644 --- a/routes/breadcrumbs.php +++ b/routes/breadcrumbs.php @@ -48,10 +48,6 @@ use Illuminate\Support\Arr; if (!function_exists('limitStringLength')) { /** * Cuts away the middle of a string when it's very long. - * - * @param string $string - * - * @return string */ function limitStringLength(string $string): string { @@ -86,14 +82,14 @@ Breadcrumbs::for( 'accounts.index', static function (Generator $breadcrumbs, string $what) { $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.' . strtolower(e($what)) . '_accounts'), route('accounts.index', [$what])); + $breadcrumbs->push(trans('firefly.'.strtolower(e($what)).'_accounts'), route('accounts.index', [$what])); } ); Breadcrumbs::for( // inactive 'accounts.inactive.index', static function (Generator $breadcrumbs, string $what) { $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.' . strtolower(e($what)) . '_accounts_inactive'), route('accounts.inactive.index', [$what])); + $breadcrumbs->push(trans('firefly.'.strtolower(e($what)).'_accounts_inactive'), route('accounts.inactive.index', [$what])); } ); @@ -101,14 +97,14 @@ Breadcrumbs::for( 'accounts.create', static function (Generator $breadcrumbs, string $what) { $breadcrumbs->parent('accounts.index', $what); - $breadcrumbs->push(trans('firefly.new_' . strtolower(e($what)) . '_account'), route('accounts.create', [$what])); + $breadcrumbs->push(trans('firefly.new_'.strtolower(e($what)).'_account'), route('accounts.create', [$what])); } ); Breadcrumbs::for( 'accounts.show', static function (Generator $breadcrumbs, Account $account, Carbon $start = null, Carbon $end = null) { - $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); + $what = config('firefly.shortNamesByFullName.'.$account->accountType->type); $breadcrumbs->parent('accounts.index', $what); $breadcrumbs->push(limitStringLength($account->name), route('accounts.show.all', [$account->id])); @@ -128,7 +124,7 @@ Breadcrumbs::for( Breadcrumbs::for( 'accounts.show.all', static function (Generator $breadcrumbs, Account $account) { - $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); + $what = config('firefly.shortNamesByFullName.'.$account->accountType->type); $breadcrumbs->parent('accounts.index', $what); $breadcrumbs->push(limitStringLength($account->name), route('accounts.show', [$account->id])); @@ -147,7 +143,7 @@ Breadcrumbs::for( 'accounts.reconcile.show', static function (Generator $breadcrumbs, Account $account, TransactionJournal $journal) { $breadcrumbs->parent('accounts.show', $account); - $title = trans('firefly.reconciliation') . ' "' . $journal->description . '"'; + $title = trans('firefly.reconciliation').' "'.$journal->description.'"'; $breadcrumbs->push($title, route('accounts.reconcile.show', [$journal->id])); } ); @@ -164,10 +160,10 @@ Breadcrumbs::for( 'accounts.edit', static function (Generator $breadcrumbs, Account $account) { $breadcrumbs->parent('accounts.show', $account); - $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); + $what = config('firefly.shortNamesByFullName.'.$account->accountType->type); $breadcrumbs->push( - trans('firefly.edit_' . $what . '_account', ['name' => limitStringLength($account->name)]), + trans('firefly.edit_'.$what.'_account', ['name' => limitStringLength($account->name)]), route('accounts.edit', [$account->id]) ); } @@ -1066,7 +1062,7 @@ Breadcrumbs::for( 'transactions.index', static function (Generator $breadcrumbs, string $what, Carbon $start = null, Carbon $end = null) { $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('breadcrumbs.' . $what . '_list'), route('transactions.index', [$what])); + $breadcrumbs->push(trans('breadcrumbs.'.$what.'_list'), route('transactions.index', [$what])); if (null !== $start && null !== $end) { // add date range: @@ -1086,7 +1082,7 @@ Breadcrumbs::for( 'transactions.index.all', static function (Generator $breadcrumbs, string $what) { $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('breadcrumbs.' . $what . '_list'), route('transactions.index', [$what])); + $breadcrumbs->push(trans('breadcrumbs.'.$what.'_list'), route('transactions.index', [$what])); } ); diff --git a/routes/web.php b/routes/web.php index f3f7ecc124..d1a342679c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -52,9 +52,7 @@ Route::group( } ); -/** - * These routes only work when the user is NOT logged in. - */ +// These routes only work when the user is NOT logged in. Route::group( ['middleware' => 'user-not-logged-in', 'namespace' => 'FireflyIII\Http\Controllers'], static function () { @@ -79,24 +77,19 @@ Route::group( } ); -/** - * For some other routes, it is only relevant that the user is authenticated. - */ +// For some other routes, it is only relevant that the user is authenticated. Route::group( ['middleware' => 'user-simple-auth', 'namespace' => 'FireflyIII\Http\Controllers'], static function () { Route::get('error', ['uses' => 'DebugController@displayError', 'as' => 'error']); Route::post('logout', ['uses' => 'Auth\LoginController@logout', 'as' => 'logout']); Route::get('flush', ['uses' => 'DebugController@flush', 'as' => 'flush']); - //Route::get('routes', ['uses' => 'DebugController@routes', 'as' => 'routes']); + // Route::get('routes', ['uses' => 'DebugController@routes', 'as' => 'routes']); Route::get('debug', 'DebugController@index')->name('debug'); } ); -/** - * For the two factor routes, the user must be logged in, but NOT 2FA. Account confirmation does not matter here. - * - */ +// For the two factor routes, the user must be logged in, but NOT 2FA. Account confirmation does not matter here. Route::group( ['middleware' => 'user-logged-in-no-2fa', 'prefix' => 'two-factor', 'as' => 'two-factor.', 'namespace' => 'FireflyIII\Http\Controllers\Auth'], static function () { @@ -105,13 +98,9 @@ Route::group( } ); -/** - * For all other routes, the user must be fully authenticated and have an activated account. - */ +// For all other routes, the user must be fully authenticated and have an activated account. -/** - * Home Controller. - */ +// Home Controller. Route::group( ['middleware' => ['user-full-auth'], 'namespace' => 'FireflyIII\Http\Controllers'], static function () { @@ -124,7 +113,7 @@ Route::group( // show inactive -/** +/* * Account Controller. * DROP ME WHEN v2 hits */ @@ -161,33 +150,36 @@ Route::group( // show Route::get('show/{account}/all', ['uses' => 'Account\ShowController@showAll', 'as' => 'show.all']); Route::get('show/{account}/{start_date?}/{end_date?}', ['uses' => 'Account\ShowController@show', 'as' => 'show']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; // reconcile routes: Route::get('reconcile/{account}/index/{start_date?}/{end_date?}', ['uses' => 'Account\ReconcileController@reconcile', 'as' => 'reconcile']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; Route::post('reconcile/{account}/submit/{start_date?}/{end_date?}', ['uses' => 'Account\ReconcileController@submit', 'as' => 'reconcile.submit']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; // reconcile JSON routes Route::get('reconcile/{account}/overview/{start_date?}/{end_date?}', ['uses' => 'Json\ReconcileController@overview', 'as' => 'reconcile.overview']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'reconcile/{account}/transactions/{start_date?}/{end_date?}', ['uses' => 'Json\ReconcileController@transactions', 'as' => 'reconcile.transactions'] ) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Attachment Controller. - */ +// Attachment Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'attachments', 'as' => 'attachments.'], static function () { @@ -202,9 +194,7 @@ Route::group( } ); -/** - * Bills Controller. - */ +// Bills Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'bills', 'as' => 'bills.'], static function () { @@ -241,9 +231,7 @@ Route::group( } ); -/** - * Budget Controller. - */ +// Budget Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'budgets', 'as' => 'budgets.'], static function () { @@ -264,28 +252,29 @@ Route::group( Route::get('show/{budget}/{budgetLimit}', ['uses' => 'Budget\ShowController@showByBudgetLimit', 'as' => 'show.limit']); Route::get('list/no-budget/all', ['uses' => 'Budget\ShowController@noBudgetAll', 'as' => 'no-budget-all']); Route::get('list/no-budget/{start_date?}/{end_date?}', ['uses' => 'Budget\ShowController@noBudget', 'as' => 'no-budget']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; // reorder budgets Route::post('reorder', ['uses' => 'Budget\IndexController@reorder', 'as' => 'reorder']); // index Route::get('{start_date?}/{end_date?}', ['uses' => 'Budget\IndexController@index', 'as' => 'index']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Budget Limit Controller. - */ +// Budget Limit Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'budget-limits', 'as' => 'budget-limits.'], static function () { Route::get('create/{budget}/{start_date}/{end_date}', ['uses' => 'Budget\BudgetLimitController@create', 'as' => 'create']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; Route::post('store', ['uses' => 'Budget\BudgetLimitController@store', 'as' => 'store']); Route::post('delete/{budgetLimit}', ['uses' => 'Budget\BudgetLimitController@delete', 'as' => 'delete']); @@ -294,9 +283,7 @@ Route::group( } ); -/** - * Category Controller. - */ +// Category Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'categories', 'as' => 'categories.'], static function () { @@ -318,20 +305,20 @@ Route::group( // show category: Route::get('show/{category}/all', ['uses' => 'Category\ShowController@showAll', 'as' => 'show.all']); Route::get('show/{category}/{start_date?}/{end_date?}', ['uses' => 'Category\ShowController@show', 'as' => 'show']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; // no category controller: Route::get('list/no-category/all', ['uses' => 'Category\NoCategoryController@showAll', 'as' => 'no-category.all']); Route::get('list/no-category/{start_date?}/{end_date?}', ['uses' => 'Category\NoCategoryController@show', 'as' => 'no-category']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Currency Controller. - */ +// Currency Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\TransactionCurrency', 'prefix' => 'currencies', 'as' => 'currencies.'], static function () { @@ -346,9 +333,7 @@ Route::group( } ); -/** - * Chart\Account Controller (default report). - */ +// Chart\Account Controller (default report). Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/account', 'as' => 'chart.account.'], static function () { @@ -356,31 +341,34 @@ Route::group( Route::get('expense', ['uses' => 'AccountController@expenseAccounts', 'as' => 'expense']); Route::get('revenue', ['uses' => 'AccountController@revenueAccounts', 'as' => 'revenue']); Route::get('report/{accountList}/{start_date}/{end_date}', ['uses' => 'AccountController@report', 'as' => 'report']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; Route::get('period/{account}/{start_date}/{end_date}', ['uses' => 'AccountController@period', 'as' => 'period']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; Route::get('income-category/{account}/all/all', ['uses' => 'AccountController@incomeCategoryAll', 'as' => 'income-category-all']); Route::get('expense-category/{account}/all/all', ['uses' => 'AccountController@expenseCategoryAll', 'as' => 'expense-category-all']); Route::get('expense-budget/{account}/all/all', ['uses' => 'AccountController@expenseBudgetAll', 'as' => 'expense-budget-all']); Route::get('income-category/{account}/{start_date}/{end_date}', ['uses' => 'AccountController@incomeCategory', 'as' => 'income-category']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; Route::get('expense-category/{account}/{start_date}/{end_date}', ['uses' => 'AccountController@expenseCategory', 'as' => 'expense-category']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; Route::get('expense-budget/{account}/{start_date}/{end_date}', ['uses' => 'AccountController@expenseBudget', 'as' => 'expense-budget']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Chart\Bill Controller. - */ +// Chart\Bill Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/bill', 'as' => 'chart.bill.'], static function () { @@ -389,19 +377,19 @@ Route::group( } ); -/** - * Chart\Budget Controller. - */ +// Chart\Budget Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/budget', 'as' => 'chart.budget.'], static function () { Route::get('frontpage', ['uses' => 'BudgetController@frontpage', 'as' => 'frontpage']); Route::get('period/0/{currency}/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@periodNoBudget', 'as' => 'period.no-budget']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; Route::get('period/{budget}/{currency}/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@period', 'as' => 'period']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; Route::get('budget/{budget}/{budgetLimit}', ['uses' => 'BudgetController@budgetLimit', 'as' => 'budget-limit']); Route::get('budget/{budget}', ['uses' => 'BudgetController@budget', 'as' => 'budget']); @@ -415,30 +403,32 @@ Route::group( 'category/expense/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetReportController@categoryExpense', 'as' => 'category-expense'] ) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'budget/expense/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetReportController@budgetExpense', 'as' => 'budget-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'source-account/expense/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetReportController@sourceAccountExpense', 'as' => 'source-account-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'destination-account/expense/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetReportController@destinationAccountExpense', 'as' => 'destination-account-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('operations/{accountList}/{budget}/{start_date}/{end_date}', ['uses' => 'BudgetReportController@mainChart', 'as' => 'main']); } ); -/** - * Chart\Category Controller. - */ +// Chart\Category Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/category', 'as' => 'chart.category.'], static function () { @@ -450,153 +440,173 @@ Route::group( 'report-period/0/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@reportPeriodNoCategory', 'as' => 'period.no-category'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('report-period/{category}/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@reportPeriod', 'as' => 'period'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'category/expense/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@categoryExpense', 'as' => 'category-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'category/income/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@categoryIncome', 'as' => 'category-income'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'budget/expense/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@budgetExpense', 'as' => 'budget-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'source/expense/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@sourceExpense', 'as' => 'source-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'source/income/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@sourceIncome', 'as' => 'source-income'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'dest/expense/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@destinationExpense', 'as' => 'dest-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'dest/income/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@destinationIncome', 'as' => 'dest-income'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('operations/{accountList}/{category}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@mainChart', 'as' => 'main'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Chart\Tag Controller. - */ +// Chart\Tag Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/tag', 'as' => 'chart.tag.'], static function () { Route::get('tag/expense/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@tagExpense', 'as' => 'tag-expense']) - ->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['start_date' => DATEFORMAT]) + ->where(['end_date' => DATEFORMAT]) + ; Route::get('tag/income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@tagIncome', 'as' => 'tag-income'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'category/expense/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@categoryExpense', 'as' => 'category-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'category/income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@categoryIncome', 'as' => 'category-income'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'budget/expense/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@budgetExpense', 'as' => 'budget-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'source/expense/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@sourceExpense', 'as' => 'source-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'source/income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@sourceIncome', 'as' => 'source-income'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'dest/expense/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@destinationExpense', 'as' => 'dest-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'dest/income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@destinationIncome', 'as' => 'dest-income'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('operations/{accountList}/{tag}/{start_date}/{end_date}', ['uses' => 'TagReportController@mainChart', 'as' => 'main'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Chart\Double Controller (for expense/revenue report). - */ +// Chart\Double Controller (for expense/revenue report). Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/double', 'as' => 'chart.double.'], static function () { Route::get('main/{accountList}/{account}/{start_date}/{end_date}', ['uses' => 'DoubleReportController@mainChart', 'as' => 'main'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'category/expense/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleReportController@categoryExpense', 'as' => 'category-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'category/income/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleReportController@categoryIncome', 'as' => 'category-income'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'budget/expense/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleReportController@budgetExpense', 'as' => 'budget-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'tag/expense/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleReportController@tagExpense', 'as' => 'tag-expense'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'tag/income/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleReportController@tagIncome', 'as' => 'tag-income'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Chart\PiggyBank Controller. - */ +// Chart\PiggyBank Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/piggy-bank', 'as' => 'chart.piggy-bank.'], static function () { @@ -604,51 +614,50 @@ Route::group( } ); -/** - * Chart\Report Controller. - */ +// Chart\Report Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/report', 'as' => 'chart.report.'], static function () { Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@operations', 'as' => 'operations'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('net-worth/{accountList}/{start_date}/{end_date}/', ['uses' => 'ReportController@netWorth', 'as' => 'net-worth'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Chart\Transactions Controller. - */ +// Chart\Transactions Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/transactions', 'as' => 'chart.transactions.'], static function () { Route::get('categories/{objectType}/{start_date}/{end_date}', ['uses' => 'TransactionController@categories', 'as' => 'categories'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('budgets/{start_date}/{end_date}', ['uses' => 'TransactionController@budgets', 'as' => 'budgets'])->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'destinationAccounts/{objectType}/{start_date}/{end_date}', ['uses' => 'TransactionController@destinationAccounts', 'as' => 'destinationAccounts'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('sourceAccounts/{objectType}/{start_date}/{end_date}', ['uses' => 'TransactionController@sourceAccounts', 'as' => 'sourceAccounts'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); - // + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Export controller. - */ +// Export controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'export', 'as' => 'export.'], static function () { @@ -657,9 +666,7 @@ Route::group( Route::post('export', ['uses' => 'Export\IndexController@export', 'as' => 'export']); } ); -/** - * Object group controller. - */ +// Object group controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'groups', 'as' => 'object-groups.'], static function () { @@ -677,9 +684,7 @@ Route::group( } ); -/** - * JScript Controller. - */ +// JScript Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'v1/jscript', 'as' => 'javascript.'], static function () { @@ -689,9 +694,7 @@ Route::group( } ); -/** - * JScript Controller. - */ +// JScript Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'v2/jscript', 'as' => 'javascript.v2.'], static function () { @@ -699,9 +702,7 @@ Route::group( } ); -/** - * JSON Controller(s). - */ +// JSON Controller(s). Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'json', 'as' => 'json.'], static function () { @@ -710,7 +711,8 @@ Route::group( 'budget/total-budgeted/{currency}/{start_date}/{end_date}', ['uses' => 'Json\BudgetController@getBudgetInformation', 'as' => 'budget.total-budgeted'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; // boxes Route::get('box/balance', ['uses' => 'Json\BoxController@balance', 'as' => 'box.balance']); Route::get('box/available', ['uses' => 'Json\BoxController@available', 'as' => 'box.available']); @@ -733,9 +735,7 @@ Route::group( } ); -/** - * NewUser Controller. - */ +// NewUser Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'new-user', 'as' => 'new-user.'], static function () { @@ -744,9 +744,7 @@ Route::group( } ); -/** - * Piggy Bank Controller. - */ +// Piggy Bank Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'piggy-banks', 'as' => 'piggy-banks.'], static function () { @@ -769,9 +767,7 @@ Route::group( } ); -/** - * Preferences Controller. - */ +// Preferences Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'preferences', 'as' => 'preferences.'], static function () { @@ -780,9 +776,7 @@ Route::group( } ); -/** - * Profile Controller. - */ +// Profile Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'profile', 'as' => 'profile.'], static function () { @@ -808,10 +802,7 @@ Route::group( } ); -/** - * Recurring Transactions Controller. - * - */ +// Recurring Transactions Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'recurring', 'as' => 'recurring.'], static function () { @@ -834,9 +825,7 @@ Route::group( } ); -/** - * Report Controller. - */ +// Report Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'reports', 'as' => 'reports.'], static function () { @@ -856,35 +845,31 @@ Route::group( } ); -/** - * Report Data AccountController. - */ +// Report Data AccountController. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/account', 'as' => 'report-data.account.'], static function () { Route::get('general/{accountList}/{start_date}/{end_date}', ['uses' => 'AccountController@general', 'as' => 'general'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Report Data Bill Controller. - */ +// Report Data Bill Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/bill', 'as' => 'report-data.bills.'], static function () { Route::get('overview/{accountList}/{start_date}/{end_date}', ['uses' => 'BillController@overview', 'as' => 'overview'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Report Double Data Expense / Revenue Account Controller. - */ +// Report Double Data Expense / Revenue Account Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/double', 'as' => 'report-data.double.'], static function () { @@ -892,38 +877,42 @@ Route::group( Route::get('operations/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@operations', 'as' => 'operations'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'ops-asset/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@operationsPerAsset', 'as' => 'ops-asset'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'top-expenses/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@topExpenses', 'as' => 'top-expenses'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'avg-expenses/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@avgExpenses', 'as' => 'avg-expenses'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('top-income/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@topIncome', 'as' => 'top-income'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('avg-income/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@avgIncome', 'as' => 'avg-income'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Report Data Income/Expenses Controller (called financial operations). - */ +// Report Data Income/Expenses Controller (called financial operations). Route::group( [ 'middleware' => 'user-full-auth', @@ -935,21 +924,22 @@ Route::group( Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@operations', 'as' => 'operations'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@income', 'as' => 'income'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@expenses', 'as' => 'expenses'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Report Data Category Controller. - */ +// Report Data Category Controller. Route::group( [ 'middleware' => 'user-full-auth', @@ -962,55 +952,63 @@ Route::group( Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@operations', 'as' => 'operations'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@income', 'as' => 'income'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@expenses', 'as' => 'expenses'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('accounts/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@accounts', 'as' => 'accounts'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('categories/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@categories', 'as' => 'categories'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'account-per-category/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@accountPerCategory', 'as' => 'account-per-category'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'top-expenses/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@topExpenses', 'as' => 'top-expenses'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'avg-expenses/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@avgExpenses', 'as' => 'avg-expenses'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('top-income/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@topIncome', 'as' => 'top-income'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('avg-income/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@avgIncome', 'as' => 'avg-income'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Report Data TAG Controller. - */ +// Report Data TAG Controller. Route::group( [ 'middleware' => 'user-full-auth', @@ -1022,93 +1020,102 @@ Route::group( Route::get('accounts/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@accounts', 'as' => 'accounts'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('tags/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@tags', 'as' => 'tags'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'account-per-tag/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@accountPerTag', 'as' => 'account-per-tag'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('top-expenses/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@topExpenses', 'as' => 'top-expenses'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('avg-expenses/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@avgExpenses', 'as' => 'avg-expenses'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('top-income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@topIncome', 'as' => 'top-income'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('avg-income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@avgIncome', 'as' => 'avg-income'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Report Data Balance Controller. - */ +// Report Data Balance Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/balance', 'as' => 'report-data.balance.'], static function () { Route::get('general/{accountList}/{start_date}/{end_date}', ['uses' => 'BalanceController@general', 'as' => 'general'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Report Data Budget Controller. - */ +// Report Data Budget Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/budget', 'as' => 'report-data.budget.'], static function () { Route::get('general/{accountList}/{start_date}/{end_date}/', ['uses' => 'BudgetController@general', 'as' => 'general'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; // TODO is route still used? Route::get('period/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@period', 'as' => 'period'])->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('accounts/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@accounts', 'as' => 'accounts'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('budgets/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@budgets', 'as' => 'budgets'])->where( ['start_date' => DATEFORMAT] ) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'account-per-budget/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@accountPerBudget', 'as' => 'account-per-budget'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'top-expenses/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@topExpenses', 'as' => 'top-expenses'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get( 'avg-expenses/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@avgExpenses', 'as' => 'avg-expenses'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; } ); -/** - * Rules Controller. - */ +// Rules Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'rules', 'as' => 'rules.'], static function () { @@ -1140,9 +1147,7 @@ Route::group( } ); -/** - * Rule Groups Controller. - */ +// Rule Groups Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'rule-groups', 'as' => 'rule-groups.'], static function () { @@ -1161,9 +1166,7 @@ Route::group( } ); -/** - * Search Controller. - */ +// Search Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'search', 'as' => 'search.'], static function () { @@ -1172,9 +1175,7 @@ Route::group( } ); -/** - * Tag Controller. - */ +// Tag Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'tags', 'as' => 'tags.'], static function () { @@ -1183,7 +1184,8 @@ Route::group( Route::get('show/{tagOrId}/all', ['uses' => 'TagController@showAll', 'as' => 'show.all']); Route::get('show/{tagOrId}/{start_date?}/{end_date?}', ['uses' => 'TagController@show', 'as' => 'show'])->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; Route::get('edit/{tag}', ['uses' => 'TagController@edit', 'as' => 'edit']); Route::get('delete/{tag}', ['uses' => 'TagController@delete', 'as' => 'delete']); @@ -1195,9 +1197,7 @@ Route::group( } ); -/** - * Transaction Controller. - */ +// Transaction Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'transactions', 'as' => 'transactions.'], static function () { @@ -1210,7 +1210,8 @@ Route::group( Route::get('{what}/{start_date?}/{end_date?}', ['uses' => 'Transaction\IndexController@index', 'as' => 'index'])->where( ['what' => 'withdrawal|deposit|transfers|transfer'] )->where(['start_date' => DATEFORMAT]) - ->where(['end_date' => DATEFORMAT]); + ->where(['end_date' => DATEFORMAT]) + ; // create group: Route::get('create/{objectType}', ['uses' => 'Transaction\CreateController@create', 'as' => 'create']); @@ -1235,9 +1236,7 @@ Route::group( } ); -/** - * Transaction Mass Controller. - */ +// Transaction Mass Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Transaction', 'prefix' => 'transactions/mass', 'as' => 'transactions.mass.'], static function () { @@ -1248,9 +1247,7 @@ Route::group( } ); -/** - * Transaction Bulk Controller. - */ +// Transaction Bulk Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Transaction', 'prefix' => 'transactions/bulk', 'as' => 'transactions.bulk.'], static function () { @@ -1259,9 +1256,7 @@ Route::group( } ); -/** - * Transaction Convert Controller. - */ +// Transaction Convert Controller. Route::group( [ 'middleware' => 'user-full-auth', @@ -1275,9 +1270,7 @@ Route::group( } ); -/** - * Transaction Link Controller. - */ +// Transaction Link Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Transaction', 'prefix' => 'transactions/link', 'as' => 'transactions.link.'], static function () { @@ -1291,9 +1284,7 @@ Route::group( } ); -/** - * Report Popup Controller. - */ +// Report Popup Controller. Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Popup', 'prefix' => 'popup', 'as' => 'popup.'], static function () { @@ -1301,9 +1292,7 @@ Route::group( } ); -/* - * Webhooks management - */ +// Webhooks management Route::group( ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Webhooks', 'prefix' => 'webhooks', 'as' => 'webhooks.'], static function () { @@ -1315,9 +1304,7 @@ Route::group( } ); -/** - * For the admin routes, the user must be logged in and have the role of 'owner'. - */ +// For the admin routes, the user must be logged in and have the role of 'owner'. Route::group( ['middleware' => 'admin', 'namespace' => 'FireflyIII\Http\Controllers\Admin', 'prefix' => 'admin', 'as' => 'admin.'], static function () { diff --git a/tests/integration/Api/Autocomplete/AccountControllerTest.php b/tests/integration/Api/Autocomplete/AccountControllerTest.php index 7801028161..ac9e8e174f 100644 --- a/tests/integration/Api/Autocomplete/AccountControllerTest.php +++ b/tests/integration/Api/Autocomplete/AccountControllerTest.php @@ -27,8 +27,12 @@ use Tests\integration\TestCase; /** * Class AccountControllerTest + * + * @internal + * + * @coversNothing */ -class AccountControllerTest extends TestCase +final class AccountControllerTest extends TestCase { /** * @covers \FireflyIII\Api\V1\Controllers\Autocomplete\AccountController diff --git a/tests/integration/CreatesApplication.php b/tests/integration/CreatesApplication.php index b4ae59a714..18f9b929c7 100644 --- a/tests/integration/CreatesApplication.php +++ b/tests/integration/CreatesApplication.php @@ -27,7 +27,6 @@ use Illuminate\Foundation\Application; /** * Trait CreatesApplication - * */ trait CreatesApplication { @@ -38,7 +37,7 @@ trait CreatesApplication */ public function createApplication() { - $app = require __DIR__ . '/../../bootstrap/app.php'; + $app = require __DIR__.'/../../bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); diff --git a/tests/integration/Support/Models/BillDateCalculatorTest.php b/tests/integration/Support/Models/BillDateCalculatorTest.php index b6ec63097e..aaac778f63 100644 --- a/tests/integration/Support/Models/BillDateCalculatorTest.php +++ b/tests/integration/Support/Models/BillDateCalculatorTest.php @@ -29,8 +29,12 @@ use Tests\integration\TestCase; /** * Class BillDateCalculatorTest + * + * @internal + * + * @coversNothing */ -class BillDateCalculatorTest extends TestCase +final class BillDateCalculatorTest extends TestCase { private BillDateCalculator $calculator; diff --git a/tests/integration/Support/NavigationCustomEndOfPeriodTest.php b/tests/integration/Support/NavigationCustomEndOfPeriodTest.php index 51526f93c4..7dfbb974de 100644 --- a/tests/integration/Support/NavigationCustomEndOfPeriodTest.php +++ b/tests/integration/Support/NavigationCustomEndOfPeriodTest.php @@ -1,6 +1,5 @@ first(); diff --git a/tests/unit/Support/Calendar/CalculatorProvider.php b/tests/unit/Support/Calendar/CalculatorProvider.php index 5ce4f90828..3a7337f65c 100644 --- a/tests/unit/Support/Calendar/CalculatorProvider.php +++ b/tests/unit/Support/Calendar/CalculatorProvider.php @@ -1,6 +1,5 @@ @@ -27,7 +26,6 @@ namespace Tests\unit\Support\Calendar; use Carbon\Carbon; use FireflyIII\Support\Calendar\Periodicity; -use Generator; use Tests\unit\Support\Calendar\Periodicity\IntervalProvider; readonly class CalculatorProvider @@ -45,7 +43,7 @@ readonly class CalculatorProvider $this->label = "{$periodicity->name} {$intervalProvider->label}"; } - public static function providePeriodicityWithSkippedIntervals(): Generator + public static function providePeriodicityWithSkippedIntervals(): \Generator { $intervals = [ self::from(Periodicity::Daily, new IntervalProvider(Carbon::now(), Carbon::now()->addDays(2)), 1), diff --git a/tests/unit/Support/Calendar/CalculatorTest.php b/tests/unit/Support/Calendar/CalculatorTest.php index fb8a8c381d..711eaee1f6 100644 --- a/tests/unit/Support/Calendar/CalculatorTest.php +++ b/tests/unit/Support/Calendar/CalculatorTest.php @@ -1,6 +1,5 @@ @@ -44,8 +43,12 @@ use Tests\unit\Support\Calendar\Periodicity\YearlyTest; * @group support * @group calendar * @group calculator + * + * @internal + * + * @coversNothing */ -class CalculatorTest extends TestCase +final class CalculatorTest extends TestCase { public static function provideAllPeriodicity(): iterable { @@ -65,18 +68,6 @@ class CalculatorTest extends TestCase } } - private static function convert(Periodicity $periodicity, array $intervals): array - { - $periodicityIntervals = []; - /** @var IntervalProvider $interval */ - foreach ($intervals as $index => $interval) { - $calculator = CalculatorProvider::from($periodicity, $interval); - - $periodicityIntervals["#{$index} {$calculator->label}"] = [$calculator]; - } - return $periodicityIntervals; - } - public static function provideSkippedIntervals(): iterable { return CalculatorProvider::providePeriodicityWithSkippedIntervals(); @@ -84,6 +75,7 @@ class CalculatorTest extends TestCase /** * @dataProvider provideAllPeriodicity + * * @throws IntervalException */ public function testGivenADailyPeriodicityWhenCallTheNextDateByIntervalMethodThenReturnsTheExpectedDateSuccessful(CalculatorProvider $provider) @@ -95,6 +87,7 @@ class CalculatorTest extends TestCase /** * @dataProvider provideSkippedIntervals + * * @throws IntervalException */ public function testGivenAnEpochWithSkipIntervalNumberWhenCallTheNextDateBySkippedIntervalMethodThenReturnsTheExpectedDateSuccessful(CalculatorProvider $provider) @@ -103,4 +96,18 @@ class CalculatorTest extends TestCase $period = $calculator->nextDateByInterval($provider->epoch(), $provider->periodicity, $provider->skip); self::assertSame($provider->expected()->toDateString(), $period->toDateString()); } + + private static function convert(Periodicity $periodicity, array $intervals): array + { + $periodicityIntervals = []; + + /** @var IntervalProvider $interval */ + foreach ($intervals as $index => $interval) { + $calculator = CalculatorProvider::from($periodicity, $interval); + + $periodicityIntervals["#{$index} {$calculator->label}"] = [$calculator]; + } + + return $periodicityIntervals; + } } diff --git a/tests/unit/Support/Calendar/Periodicity/BimonthlyTest.php b/tests/unit/Support/Calendar/Periodicity/BimonthlyTest.php index aab0e7714e..0c17381cad 100644 --- a/tests/unit/Support/Calendar/Periodicity/BimonthlyTest.php +++ b/tests/unit/Support/Calendar/Periodicity/BimonthlyTest.php @@ -33,8 +33,12 @@ use FireflyIII\Support\Calendar\Periodicity\Interval; * @group support * @group calendar * @group periodicity + * + * @internal + * + * @coversNothing */ -class BimonthlyTest extends IntervalTestCase +final class BimonthlyTest extends IntervalTestCase { public static function factory(): Interval { diff --git a/tests/unit/Support/Calendar/Periodicity/DailyTest.php b/tests/unit/Support/Calendar/Periodicity/DailyTest.php index 0d7f414ca2..697b16d736 100644 --- a/tests/unit/Support/Calendar/Periodicity/DailyTest.php +++ b/tests/unit/Support/Calendar/Periodicity/DailyTest.php @@ -1,6 +1,5 @@ @@ -34,8 +33,12 @@ use FireflyIII\Support\Calendar\Periodicity\Interval; * @group support * @group calendar * @group periodicity + * + * @internal + * + * @coversNothing */ -class DailyTest extends IntervalTestCase +final class DailyTest extends IntervalTestCase { public static function factory(): Interval { diff --git a/tests/unit/Support/Calendar/Periodicity/FortnightlyTest.php b/tests/unit/Support/Calendar/Periodicity/FortnightlyTest.php index e828176222..8f0e2824ce 100644 --- a/tests/unit/Support/Calendar/Periodicity/FortnightlyTest.php +++ b/tests/unit/Support/Calendar/Periodicity/FortnightlyTest.php @@ -1,6 +1,5 @@ @@ -34,8 +33,12 @@ use FireflyIII\Support\Calendar\Periodicity\Interval; * @group support * @group calendar * @group periodicity + * + * @internal + * + * @coversNothing */ -class FortnightlyTest extends IntervalTestCase +final class FortnightlyTest extends IntervalTestCase { public static function factory(): Interval { diff --git a/tests/unit/Support/Calendar/Periodicity/HalfYearlyTest.php b/tests/unit/Support/Calendar/Periodicity/HalfYearlyTest.php index bd3e4fd262..acb1facfc0 100644 --- a/tests/unit/Support/Calendar/Periodicity/HalfYearlyTest.php +++ b/tests/unit/Support/Calendar/Periodicity/HalfYearlyTest.php @@ -1,6 +1,5 @@ @@ -34,8 +33,12 @@ use FireflyIII\Support\Calendar\Periodicity\Interval; * @group support * @group calendar * @group periodicity + * + * @internal + * + * @coversNothing */ -class HalfYearlyTest extends IntervalTestCase +final class HalfYearlyTest extends IntervalTestCase { public static function factory(): Interval { diff --git a/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php b/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php index c4cad78044..efd14eb627 100644 --- a/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php +++ b/tests/unit/Support/Calendar/Periodicity/IntervalProvider.php @@ -1,6 +1,5 @@ diff --git a/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php b/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php index 8b8ae95e5c..477a113189 100644 --- a/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php +++ b/tests/unit/Support/Calendar/Periodicity/IntervalTestCase.php @@ -1,6 +1,5 @@ @@ -33,6 +32,7 @@ abstract class IntervalTestCase extends TestCase public static function provider(): iterable { $intervals = static::provideIntervals(); + /** @var IntervalProvider $interval */ foreach ($intervals as $interval) { yield "{$interval->label}" => [$interval]; @@ -43,10 +43,6 @@ abstract class IntervalTestCase extends TestCase /** * @dataProvider provider - * - * @param IntervalProvider $provider - * - * @return void */ public function testGivenAnEpochWhenCallTheNextDateThenReturnsTheExpectedDateSuccessful(IntervalProvider $provider): void { diff --git a/tests/unit/Support/Calendar/Periodicity/MonthlyTest.php b/tests/unit/Support/Calendar/Periodicity/MonthlyTest.php index 4d5b891fe6..56ce40f45e 100644 --- a/tests/unit/Support/Calendar/Periodicity/MonthlyTest.php +++ b/tests/unit/Support/Calendar/Periodicity/MonthlyTest.php @@ -1,6 +1,5 @@ @@ -34,8 +33,12 @@ use FireflyIII\Support\Calendar\Periodicity\Interval; * @group support * @group calendar * @group periodicity + * + * @internal + * + * @coversNothing */ -class MonthlyTest extends IntervalTestCase +final class MonthlyTest extends IntervalTestCase { public static function factory(): Interval { @@ -55,7 +58,7 @@ class MonthlyTest extends IntervalTestCase new IntervalProvider(Carbon::parse('2021-01-31'), Carbon::parse('2021-02-28')), new IntervalProvider(Carbon::parse('2023-03-31'), Carbon::parse('2023-04-30')), new IntervalProvider(Carbon::parse('2023-05-31'), Carbon::parse('2023-06-30')), - //new IntervalProvider(Carbon::parse('2023-08-31'), Carbon::parse('2023-09-30')), + // new IntervalProvider(Carbon::parse('2023-08-31'), Carbon::parse('2023-09-30')), new IntervalProvider(Carbon::parse('2023-10-31'), Carbon::parse('2023-11-30')), ]; } diff --git a/tests/unit/Support/Calendar/Periodicity/QuarterlyTest.php b/tests/unit/Support/Calendar/Periodicity/QuarterlyTest.php index 82c34eb697..defe22c283 100644 --- a/tests/unit/Support/Calendar/Periodicity/QuarterlyTest.php +++ b/tests/unit/Support/Calendar/Periodicity/QuarterlyTest.php @@ -1,6 +1,5 @@ @@ -34,8 +33,12 @@ use FireflyIII\Support\Calendar\Periodicity\Interval; * @group support * @group calendar * @group periodicity + * + * @internal + * + * @coversNothing */ -class QuarterlyTest extends IntervalTestCase +final class QuarterlyTest extends IntervalTestCase { public static function factory(): Interval { diff --git a/tests/unit/Support/Calendar/Periodicity/WeeklyTest.php b/tests/unit/Support/Calendar/Periodicity/WeeklyTest.php index b076ff8c46..093abce06a 100644 --- a/tests/unit/Support/Calendar/Periodicity/WeeklyTest.php +++ b/tests/unit/Support/Calendar/Periodicity/WeeklyTest.php @@ -1,6 +1,5 @@ @@ -34,8 +33,12 @@ use FireflyIII\Support\Calendar\Periodicity\Interval; * @group support * @group calendar * @group periodicity + * + * @internal + * + * @coversNothing */ -class WeeklyTest extends IntervalTestCase +final class WeeklyTest extends IntervalTestCase { public static function factory(): Interval { diff --git a/tests/unit/Support/Calendar/Periodicity/YearlyTest.php b/tests/unit/Support/Calendar/Periodicity/YearlyTest.php index 11143238f5..4b255d4d7c 100644 --- a/tests/unit/Support/Calendar/Periodicity/YearlyTest.php +++ b/tests/unit/Support/Calendar/Periodicity/YearlyTest.php @@ -1,6 +1,5 @@ @@ -34,8 +33,12 @@ use FireflyIII\Support\Calendar\Periodicity\Interval; * @group support * @group calendar * @group periodicity + * + * @internal + * + * @coversNothing */ -class YearlyTest extends IntervalTestCase +final class YearlyTest extends IntervalTestCase { public static function factory(): Interval { diff --git a/tests/unit/Support/NavigationAddPeriodTest.php b/tests/unit/Support/NavigationAddPeriodTest.php index fa321ca07c..bd91acf40b 100644 --- a/tests/unit/Support/NavigationAddPeriodTest.php +++ b/tests/unit/Support/NavigationAddPeriodTest.php @@ -27,15 +27,18 @@ namespace Tests\unit\Support; use Carbon\Carbon; use FireflyIII\Support\Calendar\Periodicity; use FireflyIII\Support\Navigation; -use Generator; use PHPUnit\Framework\TestCase; /** * @group unit-test * @group support * @group navigation + * + * @internal + * + * @coversNothing */ -class NavigationAddPeriodTest extends TestCase +final class NavigationAddPeriodTest extends TestCase { private Navigation $navigation; diff --git a/tests/unit/Support/NavigationEndOfPeriodTest.php b/tests/unit/Support/NavigationEndOfPeriodTest.php index 4412689a4f..0474c981a5 100644 --- a/tests/unit/Support/NavigationEndOfPeriodTest.php +++ b/tests/unit/Support/NavigationEndOfPeriodTest.php @@ -32,8 +32,12 @@ use PHPUnit\Framework\TestCase; * @group unit-test * @group support * @group navigation + * + * @internal + * + * @coversNothing */ -class NavigationEndOfPeriodTest extends TestCase +final class NavigationEndOfPeriodTest extends TestCase { private Navigation $navigation; @@ -43,9 +47,6 @@ class NavigationEndOfPeriodTest extends TestCase $this->navigation = new Navigation(); } - /** - * @return iterable - */ public static function provideDates(): iterable { return [ diff --git a/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php b/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php index 8919eac544..9ecb8af6b6 100644 --- a/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php +++ b/tests/unit/Support/NavigationPreferredCarbonFormatByPeriodTest.php @@ -31,8 +31,12 @@ use PHPUnit\Framework\TestCase; * @group unit-test * @group support * @group navigation + * + * @internal + * + * @coversNothing */ -class NavigationPreferredCarbonFormatByPeriodTest extends TestCase +final class NavigationPreferredCarbonFormatByPeriodTest extends TestCase { private Navigation $navigation; diff --git a/tests/unit/Support/NavigationPreferredCarbonFormatTest.php b/tests/unit/Support/NavigationPreferredCarbonFormatTest.php index e0ba35bfa2..099fe70342 100644 --- a/tests/unit/Support/NavigationPreferredCarbonFormatTest.php +++ b/tests/unit/Support/NavigationPreferredCarbonFormatTest.php @@ -32,8 +32,12 @@ use PHPUnit\Framework\TestCase; * @group unit-test * @group support * @group navigation + * + * @internal + * + * @coversNothing */ -class NavigationPreferredCarbonFormatTest extends TestCase +final class NavigationPreferredCarbonFormatTest extends TestCase { private Navigation $navigation; diff --git a/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php b/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php index fadfc42414..f0c937699b 100644 --- a/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php +++ b/tests/unit/Support/NavigationPreferredEndOfPeriodTest.php @@ -32,8 +32,12 @@ use PHPUnit\Framework\TestCase; * @group unit-test * @group support * @group navigation + * + * @internal + * + * @coversNothing */ -class NavigationPreferredEndOfPeriodTest extends TestCase +final class NavigationPreferredEndOfPeriodTest extends TestCase { private Navigation $navigation; diff --git a/tests/unit/Support/NavigationPreferredRangeFormatTest.php b/tests/unit/Support/NavigationPreferredRangeFormatTest.php index 7280d373ee..e6ac727a16 100644 --- a/tests/unit/Support/NavigationPreferredRangeFormatTest.php +++ b/tests/unit/Support/NavigationPreferredRangeFormatTest.php @@ -32,8 +32,12 @@ use PHPUnit\Framework\TestCase; * @group unit-test * @group support * @group navigation + * + * @internal + * + * @coversNothing */ -class NavigationPreferredRangeFormatTest extends TestCase +final class NavigationPreferredRangeFormatTest extends TestCase { private Navigation $navigation; diff --git a/tests/unit/Support/NavigationPreferredSqlFormatTest.php b/tests/unit/Support/NavigationPreferredSqlFormatTest.php index 2b2c2942c8..3b2ac677e7 100644 --- a/tests/unit/Support/NavigationPreferredSqlFormatTest.php +++ b/tests/unit/Support/NavigationPreferredSqlFormatTest.php @@ -32,8 +32,12 @@ use PHPUnit\Framework\TestCase; * @group unit-test * @group support * @group navigation + * + * @internal + * + * @coversNothing */ -class NavigationPreferredSqlFormatTest extends TestCase +final class NavigationPreferredSqlFormatTest extends TestCase { private Navigation $navigation; diff --git a/tests/unit/Support/NavigationStartOfPeriodTest.php b/tests/unit/Support/NavigationStartOfPeriodTest.php index ed304ca713..9bc3bf3e85 100644 --- a/tests/unit/Support/NavigationStartOfPeriodTest.php +++ b/tests/unit/Support/NavigationStartOfPeriodTest.php @@ -33,8 +33,12 @@ use PHPUnit\Framework\TestCase; * @group unit-test * @group support * @group navigation + * + * @internal + * + * @coversNothing */ -class NavigationStartOfPeriodTest extends TestCase +final class NavigationStartOfPeriodTest extends TestCase { private Navigation $navigation; @@ -98,8 +102,9 @@ class NavigationStartOfPeriodTest extends TestCase public function testGivenADateAndUnknownFrequencyWhenCalculateTheDateThenReturnsTheSameDateSuccessful(string $frequency, Carbon $from, Carbon $expected) { Log::shouldReceive('error') - ->with(sprintf('Cannot do startOfPeriod for $repeat_freq "%s"', $frequency)) - ->andReturnNull(); + ->with(sprintf('Cannot do startOfPeriod for $repeat_freq "%s"', $frequency)) + ->andReturnNull() + ; $period = $this->navigation->startOfPeriod($from, $frequency); self::assertSame($expected->toDateString(), $period->toDateString());