Repository navigation
Prepare Objectiveweb Router v3.0.0 - #1
Merged
Merged
Conversation
While initializing Attributes with Dice, linting got broken since the Attribute misses the arguments that will be injected by DI. This changes syntax to calling #[Middleware(class, ...args)] instead of referencing the Attribute directly.
- Instantiate from Router - Set template.root and default middlewares in Router
GuilhermeBarile
previously approved these changes
Sep 30, 2026
GuilhermeBarile
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prepare Objectiveweb Router 3.0.0 as an intentionally breaking release.
Router v3 modernizes the runtime and dependency stack, narrows and types the public API, replaces legacy controller hooks with middleware, hardens HTTP/error/template behavior, and adds the CI and release verification needed for a public release.
This release does not provide backwards compatibility with Router 2.x. See
CHANGELOG.mdfor detailed 2.x → 3.x migration notes.Breaking changes
^4.1.0.Dice\\Dice.addRule()andcreate(string $name, array $args = []): object.shareargument and other inherited Dice methods are no longer part of the Router API.before()/beforePost()hooks with attribute-based middleware.before()must return the complete controller argument array.url()andredirect()are now Router instance methods.HTTP_HOSTis no longer trusted by default for absolute URL generation; configuretrusted.hostsexplicitly or use'*'to retain unrestricted host behavior._functions.php.Router::render()helper.<composer project root>/templates.head()/headFoo()are replaced by GET fallback semantics with response-body suppression.Routing and public API
mixedso invalid callbacks remain inside the controlled HTTP error boundary.route(..., mixed ...$args)andcontroller(..., mixed ...$args)explicit.PATCH().[ClassName::class, 'method']callbacks consistently.isAjax(): boolas a small public helper.Middleware and CORS
before()hooks in declaration order and implementedafter()hooks in reverse order.RequestMiddlewareInterface.addRequestMiddleware()andrequest.middlewaresconfiguration.CorsMiddleware.setCors()register/replace the CORS request middleware.Access-Control-Allow-Origin: *.HTTP and response handling
respond()pipeline.respond()dispatch for Router subclasses.Acceptmedia ranges with q-values, wildcards, and q=0 exclusions.Vary: Acceptonly when multiple representations are available.Content-Type.application/jsonand structuredapplication/*+jsonmedia types.Error boundary and disclosure
Throwablefailures at the route boundary, including dependency-injection and callback-resolution failures.debug => trueto expose development error details.Templates and URL generation
EXTR_SKIP, protected layout contents, and exact output-buffer restoration after failures.Template::url(), backed by the owning Router.trusted.proxiessupport for exact IPv4/IPv6 addresses and CIDR ranges.trusted.hostsvalidation for directHTTP_HOSTusage.url('0'), IPv6 hosts/ports, proxy behavior, and redirects.Documentation and migration
CHANGELOG.mdwith detailed 2.x → 3.x migration guidance.LICENSE.Dependencies and CI
composer update --prefer-lowest --prefer-stable.composer validate --strict.--fail-on-deprecation --display-deprecations.^3.32.masterand manual dispatch, including:composer install --no-devverification.Test coverage
The v3 suite now covers, among other areas:
Current verification
Current
develHEAD is green on:composer validate --strictDeferred follow-up
Objectiveweb Auth compatibility with the Router v3 middleware contract will be handled separately after this release.
Remaining release checklist
masterand verify the automatically triggered Release verification workflow passes, including the production--no-devinstall.v3.0.0manually after themasterrelease verification passes.composer require objectiveweb/router:^3.0install and confirm Packagist sees the v3 tag.