refactor: move PSR-15 classes inside the Http boundary - #19
Merged
Merged
Conversation
The ecosystem guard perimeter rule allows Psr\Http\Server\** only from Webware\**\Http\**, so the PSR-15 classes have to live under Http\ before the webware-tools bump lands. - src/Middleware/* -> src/Http/Middleware/* - MessageMiddlewareFactory -> Http\Middleware\Container: the Http\Middleware structural rule requires every class there to be named *Middleware and implement MiddlewareInterface, so factories nest in Container\ (matching webware-acl, webware-usermanager and webware-mailer). - MissingSessionException::forMiddleware() now takes the middleware class name rather than a PSR-15 instance, dropping its Psr\Http\Server dependency. - Tests mirror the new src layout. Signed-off-by: Joey Smith <jsmith@webinertia.net>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Closes #17.
Relocates the PSR-15 classes under the
Http\perimeter so the ecosystem guard rule(
Psr\Http\Server\**usable only fromWebware\**\Http\**) passes once webware-tools0.1.xis updated. This is what unblocks #18.src/Middleware/*->src/Http/Middleware/*.MessageMiddlewareFactory->Http\Middleware\Container\. The newHttp\**\Middleware\*structural rule requires every class directly in thatnamespace to be named
*Middlewareand implement PSR-15MiddlewareInterface,so the factory cannot stay co-located; it nests in
Container\, matchingwebware-acl,webware-usermanagerandwebware-mailer.MissingSessionException::forMiddleware()now takes the middleware class name(
string $middlewareClass, documented asclass-string) instead of a PSR-15instance, which drops the exception's
Psr\Http\Serverdependency.srclayout; README anddocs/v1/*wiring examples updated.Verified against webware-tools
0.1.x(mago 1.48.1,guard.mode = "default"with theperimeter rules active — swapped into the ignored vendor copy for the run, so
composer.lockis untouched):mago fmt --check,mago lint,mago analyzeandmago guardare all clean, andphpunitpasses 70 unit + 1 integration test.Commit is signed off.
Merge up: lands on
1.0.xfirst.