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

tempestphp / tempest-framework / 14215397056

02 Apr 2025 08:46AM UTC coverage: 81.049% (+0.01%) from 81.035%
14215397056

Pull #1109

github

web-flow
Merge 476b9d554 into 9c84c680a
Pull Request #1109: feat(core): add middleware priority and discovery

74 of 93 new or added lines in 16 files covered. (79.57%)

11162 of 13772 relevant lines covered (81.05%)

102.6 hits per line

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

57.14
/src/Tempest/Router/src/HttpMiddlewareDiscovery.php
1
<?php
2

3
namespace Tempest\Router;
4

5
use Tempest\Discovery\Discovery;
6
use Tempest\Discovery\DiscoveryLocation;
7
use Tempest\Discovery\IsDiscovery;
8
use Tempest\Reflection\ClassReflector;
9

10
final class HttpMiddlewareDiscovery implements Discovery
11
{
12
    use IsDiscovery;
13

14
    public function __construct(
726✔
15
        private readonly RouteConfig $routeConfig,
16
    ) {}
726✔
17

NEW
18
    public function discover(DiscoveryLocation $location, ClassReflector $class): void
×
19
    {
NEW
20
        if ($class->implements(HttpMiddleware::class)) {
×
NEW
21
            $this->discoveryItems->add($location, $class->getName());
×
22
        }
23
    }
24

25
    public function apply(): void
726✔
26
    {
27
        $this->routeConfig->middleware->add(...$this->discoveryItems);
726✔
28
    }
29
}
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