Skip to content

Releases: Digital-Media/fhooe-router

v1.0.0

05 Feb 15:25
v1.0.0
f267b61
Compare
Choose a tag to compare

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() and redirectTo to never.
  • addRoute() now accepts an enum HttpMethod 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 a TypeError. 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

24 Jan 01:05
v0.3.0
5be0e23
Compare
Choose a tag to compare

0.3.0 - 2022-01-24

Added

  • Added two redirect methods to the router. redirectTo() will accept a route pattern, whereas redirect() 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

22 Dec 15:21
v0.2.0
529c525
Compare
Choose a tag to compare

0.2.0 - 2021-12-22

Added

  • The Router class is now PSR-3 compatible and builds upon the Psr\Log interfaces. The class uses the LoggerAwareTrait to instantiate a logger instance with NullLogger. 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

16 Dec 00:13
v0.1.0
b635b75
Compare
Choose a tag to compare

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.