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

slimphp / Slim / 2781
97%
3.x: 98%

Build:
Build:
LAST BUILD BRANCH: nyholmServerWithoutClient
DEFAULT BRANCH: 3.x
Ran 24 Jan 2019 05:35PM UTC
Jobs 1
Files 42
Run time 184min
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
2781

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 style 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\PsrMiddleware
 - Routable with PSR-15 Middlewares

Resolves #2050
Pull Request #2379: Add support for PSR-15 middlewares

33 of 33 new or added lines in 8 files covered. (100.0%)

651 of 668 relevant lines covered (97.46%)

18.2 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2781.1 (ANALYSIS='true') 24 Jan 2019 05:35PM UTC 0
97.46
Travis Job 2781.1
Source Files on build 2781
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2781
  • Pull Request #2379
  • PR Base - 4.x (#2775)
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