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

tempestphp / tempest-framework / 14049246919

24 Mar 2025 09:42PM UTC coverage: 79.353% (-0.04%) from 79.391%
14049246919

push

github

web-flow
feat(support): support array parameters in string manipulations (#1073)

48 of 48 new or added lines in 2 files covered. (100.0%)

735 existing lines in 126 files now uncovered.

10492 of 13222 relevant lines covered (79.35%)

90.78 hits per line

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

0.0
/src/Tempest/Console/src/Components/Static/StaticTaskComponent.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Console\Components\Static;
6

7
use Closure;
8
use DateTimeImmutable;
9
use Symfony\Component\Process\Process;
10
use Tempest\Console\Console;
11
use Tempest\Console\StaticConsoleComponent;
12
use Throwable;
13

14
final class StaticTaskComponent implements StaticConsoleComponent
15
{
16
    public function __construct(
×
17
        readonly string $label,
18
        private null|Process|Closure $handler = null,
UNCOV
19
    ) {}
×
20

UNCOV
21
    public function render(Console $console): bool
×
22
    {
UNCOV
23
        $console->keyValue($this->label, new DateTimeImmutable()->format('Y-m-d H:i:s'));
×
24

UNCOV
25
        $result = match (true) {
×
26
            $this->handler instanceof Closure => $this->executeClosureHandler($this->handler),
×
27
            $this->handler instanceof Process => $this->executeProcessHandler($this->handler),
×
28
            default => false,
×
29
        };
×
30

UNCOV
31
        $console->keyValue($this->label, match ($result) {
×
32
            true => '<style="bold fg-green">DONE</style>',
×
33
            default => '<style="bold fg-red">FAILED</style>',
×
34
        });
×
35

UNCOV
36
        return $result;
×
37
    }
38

UNCOV
39
    private function executeClosureHandler(Closure $handler): bool
×
40
    {
41
        try {
UNCOV
42
            return $handler(fn () => null) !== false;
×
43
        } catch (Throwable) {
×
44
            return false;
×
45
        }
46
    }
47

UNCOV
48
    private function executeProcessHandler(Process $process): bool
×
49
    {
50
        try {
UNCOV
51
            return $process->run() === 0;
×
52
        } catch (Throwable) {
×
53
            return false;
×
54
        }
55
    }
56
}
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