Various code fixes

This commit is contained in:
James Cole
2022-12-31 13:32:42 +01:00
parent 5878b2c427
commit 7722ca2bf0
34 changed files with 106 additions and 174 deletions

View File

@@ -236,84 +236,6 @@ class DebugController extends Controller
);
}
/**
* Return all possible routes.
*
* @return string
*/
public function routes(): string
{
$set = RouteFacade::getRoutes();
$ignore = [
'chart.',
'javascript.',
'json.',
'report-data.',
'popup.',
'debugbar.',
'attachments.download',
'attachments.preview',
'bills.rescan',
'budgets.income',
'currencies.def',
'error',
'flush',
'help.show',
'login',
'logout',
'password.reset',
'profile.confirm-email-change',
'profile.undo-email-change',
'register',
'report.options',
'routes',
'rule-groups.down',
'rule-groups.up',
'rules.up',
'rules.down',
'rules.select',
'search.search',
'test-flash',
'transactions.link.delete',
'transactions.link.switch',
'two-factor.lost',
'reports.options',
'debug',
'preferences.delete-code',
'rules.test-triggers',
'piggy-banks.remove-money',
'piggy-banks.add-money',
'accounts.reconcile.transactions',
'accounts.reconcile.overview',
'transactions.clone',
'two-factor.index',
'api.v1',
'installer.',
'attachments.view',
'recurring.events',
'recurring.suggest',
];
$return = ' ';
/** @var Route $route */
foreach ($set as $route) {
$name = (string)$route->getName();
if (in_array('GET', $route->methods(), true)) {
$found = false;
foreach ($ignore as $string) {
if (false !== stripos($name, $string)) {
$found = true;
break;
}
}
if (false === $found) {
$return .= 'touch '.$route->getName().'.md;';
}
}
}
return $return;
}
/**
* Flash all types of messages.
*