Releases: Upstatement/routes
Releases · Upstatement/routes
Singleton refactor, custom match types, base path support
⚠️ Beta release. APIs may shift before1.0.0stable. Please test against your projects and
file issues with feedback.
What's New
- Custom AltoRouter match types via
addMatchTypes()— register your own match type patterns
(e.g. numeric IDs, slugs, UUIDs) to use in route definitions. See the README for usage examples. - Base path support for subdirectory installations — Routes now correctly handles WordPress
installs mounted in a subdirectory. The router resolves against the relative path instead of the full
request URI.
Breaking Changes
Routesis now a singleton. Direct instantiation patterns are replaced by a single shared
instance. If you were holding your ownnew Routes()reference, switch to the singleton accessor —
see README for the migration path.- Several internal method signatures changed to operate on instance context rather than static calls.
If you were extending or subclassingRoutes, review your overrides.
Fixes
match_current_requestnow correctly uses instance context on all call sites- Null-check on the router in
match_current_requestto guard against edge cases where no routes are
registered - Reordered class properties for clarity
Documentation
- New README section covering
addMatchTypes()with examples - New README section on base path handling for subdirectory WordPress installs
- Updated installation instructions
- Documented 1.0.0 breaking changes
Housekeeping
- Cleaned up plugin header comments
- Removed unused autoload checks
Upgrading from 0.10.0
- Replace any direct
new Routes()usage with the singleton accessor - Review any subclasses for signature changes on instance methods
- If you use subdirectory installs, verify your routes still resolve as expected (behavior changed —
should now Just Work where it previously required manual base-path hacks)
Full Changelog: 0.10.0...1.0.0-beta.1
HEAD method support, PHP 8.2, CI modernization
What's New
- HEAD method support —
Routes::map()now acceptsHEADas a valid HTTP method (#50) - PHP 8.2 required — minimum PHP version bumped from 7.3 to 8.2
- Mantle framework integration — added
mantle-framework/support,contracts, andcontaineras
dependencies
Improvements
- Major refactor of
Routes.phpfor readability, structure, and inline documentation - Modernized string operations (
str_contains,str_starts_with) for clarity and performance - Clearer parameter descriptions on
load() - Template filter callback now receives the current template parameter
Tooling & CI
- Migrated from Travis CI to GitHub Actions (lint, Rector, PHPUnit)
- Added Easy Coding Standard (
ecs.php) and Rector (rector.php) configs - Updated PHPUnit config and test bootstrap
- Rewrote test suite under
tests/RoutesTest.phpwith expanded coverage
Fixes
- Corrected "Preceeding" → "Preceding" in test names
- Reset
matches_class_testarray between class route assertions - Assorted
.gitattributes/.gitignorecleanup
Breaking Changes
- PHP 8.2 is now the minimum supported version. Projects on older PHP must stay on
0.9.2or
upgrade their runtime before installing this release.
Full Changelog: 0.9.2...0.10.0
0.9.2
What's Changed
- Fixes #46: Incompatible with AltoRouter v2.0.3 by @jameelmoses in #47
- Exclude non-essential files by @vinkla in #43
- Update composer.json to use PHP >= 7.3 by @jarednova in #48
New Contributors
- @jameelmoses made their first contribution in #47
- @vinkla made their first contribution in #43
Full Changelog: 0.9.1...0.9.2
Allow for 1.x composer installers for PHP 5.*
What's Changed
- Allow for 1.x composer installers to support WP.org deployment by @jarednova in #42
Full Changelog: 0.9...0.9.1
Fix for WordPress 6.0
Update of Composer specs
Merge pull request #33 from Upstatement/coveralls set PHP 7.x version
Update to version 2.0.2 of AltoRouter
Update version requirements
Requires PHP 5.6+ in order to be compatible w current version of AltoRouter #25
Remove some non-functional code
Removed some non-functional code that could throw an error/warning (thanks @daronspence @szepeviktor)