• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

slimphp / Slim / 2511
99%
3.x: 98%

Build:
Build:
LAST BUILD BRANCH: nyholmServerWithoutClient
DEFAULT BRANCH: 3.x
Ran 10 Jan 2018 02:00PM UTC
Jobs 1
Files 28
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
2511

Pull #2379

travis-ci

web-flow
Add support for PSR-15 style middlewares

PSR-15 middlewares can be registered using the existing API:
`App::add()` and `Routable::add()`
Those methods are extended to accept objects that implement
the MiddlewareInterface (or class names that refer to classes
which implement the MiddlewareInterface).

We do not add new entry points for middleware registration, as the type
of the middleware can be detecting through the MiddlewareInterface
which all PSR-15 middlewares implement.

Both, classes that do not implement MiddlewareInterface, and closures will
be handled as single pass middleware – as before.
That means there's no support for closures with a PSR-15 single-pass
signature.

The detection of the middleware type is implemented
in the callable resolver. While that might look like
something which is out of scope for the CallableResolver, reasons are:
a) The internal slim middleware stack stays at is – it handles callables only.
   (and in cannot be changed anyway as long double-pass middlewares
   need to be supported. Double-pass middlewares expect a Response object
   that needs to be passed along the middleware stack. Therefore we'd need to
   wrap PSR-15 middleware's in any case – which is what this change provides)
b) the CallableResolver resolves (in terms for transforms) a callable
   from PSR-15 style middleware.

TODO: Add more tests for:
 - Adapter\SinglePassMiddleware
 - Routable with PSR-15 Middlewares

Closes: #2050
Closes: #2051
Pull Request #2379: [RFC] Add support for PSR-15 style middlewares

16 of 16 new or added lines in 7 files covered. (100.0%)

652 of 686 relevant lines covered (95.04%)

17.66 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
100.0
Slim/Routable.php
Jobs
ID Job ID Ran Files Coverage
2 2511.2 (ANALYSIS='true') 10 Jan 2018 02:00PM UTC 0
95.04
Travis Job 2511.2
Source Files on build 2511
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2511
  • Pull Request #2379
  • PR Base - 4.x (#2509)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc