• 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/Console/src/Discovery/ConsoleCommandDiscovery.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Console\Discovery;
6

7
use Tempest\Console\ConsoleCommand;
8
use Tempest\Console\ConsoleConfig;
9
use Tempest\Core\Discovery;
10
use Tempest\Core\DiscoveryLocation;
11
use Tempest\Core\IsDiscovery;
12
use Tempest\Reflection\ClassReflector;
13

14
final class ConsoleCommandDiscovery implements Discovery
15
{
16
    use IsDiscovery;
17

18
    public function __construct(
382✔
19
        private readonly ConsoleConfig $consoleConfig,
20
    ) {
21
    }
382✔
22

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

28
            if (! $consoleCommand) {
×
29
                continue;
×
30
            }
31

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

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