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

tempestphp / tempest-framework / 12021710761

25 Nov 2024 06:54PM UTC coverage: 79.441% (-2.6%) from 81.993%
12021710761

push

github

web-flow
ci: close stale issues and pull requests

7879 of 9918 relevant lines covered (79.44%)

61.32 hits per line

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

45.45
/src/Tempest/Http/src/Static/StaticPageDiscovery.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Http\Static;
6

7
use Tempest\Core\Discovery;
8
use Tempest\Core\DiscoveryLocation;
9
use Tempest\Core\IsDiscovery;
10
use Tempest\Http\StaticPage;
11
use Tempest\Reflection\ClassReflector;
12

13
final class StaticPageDiscovery implements Discovery
14
{
15
    use IsDiscovery;
16

17
    public function __construct(
382✔
18
        private readonly StaticPageConfig $staticPageConfig,
19
    ) {
20
    }
382✔
21

22
    public function discover(DiscoveryLocation $location, ClassReflector $class): void
×
23
    {
24
        foreach ($class->getPublicMethods() as $method) {
×
25
            $staticPage = $method->getAttribute(StaticPage::class);
×
26

27
            if (! $staticPage) {
×
28
                continue;
×
29
            }
30

31
            $this->discoveryItems->add($location, [$staticPage, $method]);
×
32
        }
33
    }
34

35
    public function apply(): void
382✔
36
    {
37
        foreach ($this->discoveryItems as [$staticPage, $method]) {
382✔
38
            $this->staticPageConfig->addHandler($staticPage, $method);
382✔
39
        }
40
    }
41
}
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