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

tempestphp / tempest-framework / 14111534682

27 Mar 2025 04:16PM UTC coverage: 79.27% (-0.06%) from 79.334%
14111534682

Pull #1084

github

web-flow
Merge 7e574b4eb into 6af05d563
Pull Request #1084: feat(router): introduce response processors

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

17 existing lines in 1 file now uncovered.

10550 of 13309 relevant lines covered (79.27%)

91.51 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(
665✔
17
        private readonly RouteConfig $routeConfig,
18
    ) {}
665✔
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
665✔
30
    {
31
        foreach ($this->discoveryItems as [$className]) {
665✔
32
            $viewProcessor = new ClassReflector($className);
665✔
33

34
            $this->routeConfig->addResponseProcessor($viewProcessor->getName());
665✔
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