Skip to content

refactor: move PSR-15 classes inside the Http boundary - #19

Merged
tyrsson merged 1 commit into
1.0.xfrom
refactor/http-boundary
Sep 18, 2026
Merged

tyrsson merged 1 commit into
1.0.xfrom
refactor/http-boundary

Conversation

@tyrsson

@tyrsson tyrsson commented Sep 18, 2026

Copy link
Copy Markdown
Member

Closes #17.

Relocates the PSR-15 classes under the Http\ perimeter so the ecosystem guard rule
(Psr\Http\Server\** usable only from Webware\**\Http\**) passes once webware-tools
0.1.x is updated. This is what unblocks #18.

  • src/Middleware/* -> src/Http/Middleware/*.
  • MessageMiddlewareFactory -> Http\Middleware\Container\. The new
    Http\**\Middleware\* structural rule requires every class directly in that
    namespace to be named *Middleware and implement PSR-15 MiddlewareInterface,
    so the factory cannot stay co-located; it nests in Container\, matching
    webware-acl, webware-usermanager and webware-mailer.
  • MissingSessionException::forMiddleware() now takes the middleware class name
    (string $middlewareClass, documented as class-string) instead of a PSR-15
    instance, which drops the exception's Psr\Http\Server dependency.
  • Unit tests mirror the new src layout; README and docs/v1/* wiring examples updated.

Verified against webware-tools 0.1.x (mago 1.48.1, guard.mode = "default" with the
perimeter rules active — swapped into the ignored vendor copy for the run, so
composer.lock is untouched): mago fmt --check, mago lint, mago analyze and
mago guard are all clean, and phpunit passes 70 unit + 1 integration test.
Commit is signed off.

Merge up: lands on 1.0.x first.

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

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tyrsson
tyrsson merged commit fa7cb1a into 1.0.x Sep 18, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Http boundary realignment: relocate middleware, decouple MissingSessionException

1 participant