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

ICanBoogie / Routing / 11642061502

02 Nov 2024 10:41AM UTC coverage: 97.454% (+0.5%) from 96.984%
11642061502

push

github

olvlvl
Tidy documentation

421 of 432 relevant lines covered (97.45%)

6.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/lib/ActionResponderProvider/WithMiddleware.php
1
<?php
2

3
namespace ICanBoogie\Routing\ActionResponderProvider;
4

5
use ICanBoogie\HTTP\Responder;
6
use ICanBoogie\Routing\MiddlewareCollection;
7
use ICanBoogie\Routing\ActionResponderProvider;
8

9
/**
10
 * Decorates responders with middleware.
11
 */
12
final readonly class WithMiddleware implements ActionResponderProvider
13
{
14
    public function __construct(
15
        private ActionResponderProvider $next,
16
        private MiddlewareCollection $middleware,
17
    ) {
18
    }
1✔
19

20
    public function responder_for_action(string $action): ?Responder
21
    {
22
        $responder = $this->next->responder_for_action($action);
1✔
23

24
        if (!$responder) {
1✔
25
            return null;
×
26
        }
27

28
        return $this->middleware->chain($responder);
1✔
29
    }
30
}
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

© 2025 Coveralls, Inc