mecha-cms / mecha

Minimalist content management system.

Home Page:https://mecha-cms.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TODO: Rename `Route::over()` to `Route::hit()`

taufik-nurrohman opened this issue · comments

The term hit is more appropriate to me. over seems to have missed the under, something that will never exist for routes because every success response will be immediately stopped by exit. So, even if we have Route::under() someday, then its callback function is likely will never be executed due to the exit expression at the end of the response.

Route::hit('foo/bar', function() {});

This method is in line with the Cache::hit() method so it is easy to scan and remember the API.

Possible extension that will be affected by this change:

Consider to use if (Route::is('foo/bar')) {} where applicable since this method is likely will be exist forever.