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

tempestphp / tempest-framework / 14110222274

27 Mar 2025 03:17PM UTC coverage: 79.282% (-0.05%) from 79.334%
14110222274

Pull #1084

github

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

40 of 59 new or added lines in 7 files covered. (67.8%)

17 existing lines in 1 file now uncovered.

10550 of 13307 relevant lines covered (79.28%)

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

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