Skip to content

v2.0.0

Choose a tag to compare

@SoloPHP SoloPHP released this 16 Oct 15:28
· 13 commits to main since this release

Major rewrite, enhancing type safety, performance, and flexibility with advanced routing features while preserving core functionality.

Major Enhancements

  • Advanced Optional Segments: Supports complex patterns like /shop[/category/{cat}[/subcat/{subcat}]] via PatternCompiler with regex and bracket validation.
  • Optimized Matching: New RouteMatcher with pattern caching for faster URI resolution.
  • Type Safety: Introduces HttpMethod enum and immutable Route DTO for stricter typing.
  • RouteCollector: Fluent interface for HTTP methods; improved group prefixing and middleware merging.
  • Error Handling: Enhanced validation for unmatched brackets and duplicate route names.

Breaking Changes

  • match() returns array or false, removes page attribute.
  • Group middleware merges with route-specific middleware first.
  • String-based method validation replaced with enum.