Remove unnecessary routes.

This commit is contained in:
James Cole
2018-01-10 07:29:55 +01:00
parent a816e59a97
commit c045193246

View File

@@ -200,25 +200,28 @@ class HomeController extends Controller
'login', 'logout', 'password.reset', 'profile.confirm-email-change', 'profile.undo-email-change', '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', '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', 'rules.select', 'search.search', 'test-flash', 'transactions.link.delete', 'transactions.link.switch',
'two-factor.lost', 'report.options', 'two-factor.lost', 'reports.options', 'debug', 'import.create-job', 'import.download', 'import.start', 'import.status.json',
'preferences.delete-code', 'rules.test-triggers', 'piggy-banks.remove-money', 'piggy-banks.add-money',
'accounts.reconcile.transactions', 'accounts.reconcile.overview',
]; ];
$return = ' '; $return = ' ';
/** @var Route $route */ /** @var Route $route */
foreach ($set as $route) { foreach ($set as $route) {
$name = $route->getName(); $name = $route->getName();
if (null !== $name && in_array('GET', $route->methods()) && strlen($name) > 0) { if (null !== $name && in_array('GET', $route->methods()) && strlen($name) > 0) {
$found = false; $found = false;
foreach ($ignore as $string) { foreach ($ignore as $string) {
if (false !== strpos($name, $string)) { if (!(false === stripos($name, $string))) {
$found = true; $found = true;
break;
} }
} }
if (!$found) { if ($found === false) {
$return .= 'touch ' . $route->getName() . '.md;'; $return .= 'touch ' . $route->getName() . '.md;';
} }
} }
} }
return $return; return $return;
} }