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

tempestphp / tempest-framework / 14129587615

28 Mar 2025 01:03PM UTC coverage: 79.776%. First build
14129587615

Pull #1084

github

web-flow
Merge b96abf853 into ed6f85cc6
Pull Request #1084: feat(router): introduce response processors

43 of 64 new or added lines in 8 files covered. (67.19%)

10899 of 13662 relevant lines covered (79.78%)

95.15 hits per line

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

60.0
/src/Tempest/Router/src/ResponseProcessorDiscovery.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Router;
6

7
use Tempest\Discovery\Discovery;
8
use Tempest\Discovery\DiscoveryLocation;
9
use Tempest\Discovery\IsDiscovery;
10
use Tempest\Reflection\ClassReflector;
11

12
final class ResponseProcessorDiscovery implements Discovery
13
{
14
    use IsDiscovery;
15

16
    public function __construct(
703✔
17
        private readonly RouteConfig $routeConfig,
18
    ) {}
703✔
19

NEW
20
    public function discover(DiscoveryLocation $location, ClassReflector $class): void
×
21
    {
NEW
22
        if (! $class->implements(ResponseProcessor::class)) {
×
NEW
23
            return;
×
24
        }
25

NEW
26
        $this->discoveryItems->add($location, [$class->getName()]);
×
27
    }
28

29
    public function apply(): void
703✔
30
    {
31
        foreach ($this->discoveryItems as [$className]) {
703✔
32
            $viewProcessor = new ClassReflector($className);
703✔
33

34
            $this->routeConfig->addResponseProcessor($viewProcessor->getName());
703✔
35
        }
36
    }
37
}
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