• 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

83.33
/lib/ActionResponderProvider/Chain.php
1
<?php
2

3
namespace ICanBoogie\Routing\ActionResponderProvider;
4

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

8
/**
9
 * Tries a chain of controller providers until one provides a controller.
10
 */
11
final readonly class Chain implements ActionResponderProvider
12
{
13
    /**
14
     * @var ActionResponderProvider[]
15
     */
16
    private iterable $providers;
17

18
    public function __construct(ActionResponderProvider ...$providers)
19
    {
20
        $this->providers = $providers;
1✔
21
    }
22

23
    public function responder_for_action(string $action): ?Responder
24
    {
25
        foreach ($this->providers as $provider) {
1✔
26
            $responder = $provider->responder_for_action($action);
1✔
27

28
            if ($responder) {
1✔
29
                return $responder;
1✔
30
            }
31
        }
32

33
        return null;
×
34
    }
35
}
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