Releases: Digital-Media/fhooe-router
Releases · Digital-Media/fhooe-router
v1.0.0
1.0.0 - 2024-02-05
Added
- Added PEST for testing.
- The
Router
object ($this
) is now passed to the callback of a route for access to the router's methods.
Changed
- Switched to PHP 8.3 as a minimum requirement.
- Switched return type of
redirect()
andredirectTo
tonever
. addRoute()
now accepts an enumHttpMethod
instead of a string. This removes the necessity to check the validity of the input. If it's not a valid enum value, the interpreter throws aTypeError
. Plus, it introduces enums to students.- Checked log calls for null safety.
basePath
is now a property and not static anymore.- Class constants are now typed.
- Updated all dependencies.
Removed
composer.lock
is now excluded from version control for more flexibility.
v0.3.0
0.3.0 - 2022-01-24
Added
- Added two redirect methods to the router.
redirectTo()
will accept a route pattern, whereasredirect()
will take a URL as an argument.
Changed
urlFor()
now only accepts a route pattern (e.g. "/form"). No method has to be specified anymore since the method is not necessary in determining the full URL for a pattern.- Bumped phpstan/phpstan to 1.4.
v0.2.0
0.2.0 - 2021-12-22
Added
- The
Router
class is now PSR-3 compatible and builds upon thePsr\Log
interfaces. The class uses theLoggerAwareTrait
to instantiate a logger instance withNullLogger
. See also 2: Add logging capabilities. - Logging messages that inform users about added routes, route matches, a set 404 callback and an executed 404 callback.
- Added a static
getBasePath()
method to retrieve the base path. This can be used in view templates to prepend the base path to URLs.
v0.1.0
0.1.0 - 2021-12-16
Added
- Complete
Router
class with dynamic and static functionality. - Allowed setting routes for GET and POST protocols with patterns and invocable callbacks.
- Defined a method for adding a 404 callback handler when no route matches.
- Added a method for specifying a base path if the project is not in the server's root directory.
- Added
HandlerNotSetException
class that is thrown when no 404 callback is defined. - Added an additional static routing method as an alternative and simpler way to approach the routing concept.
- Set up
composer.json
for the use with Composer and Packagist. - Added phpstan for code analysis.
- Added extensive
README.md
. - Added notes on Contributing.
- Added this changelog.