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

tempestphp / tempest-framework / 14024978163

23 Mar 2025 05:55PM UTC coverage: 79.391% (-0.05%) from 79.441%
14024978163

push

github

web-flow
feat(view): cache Blade and Twig templates in internal storage (#1061)

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

912 existing lines in 110 files now uncovered.

10478 of 13198 relevant lines covered (79.39%)

91.09 hits per line

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

0.0
/src/Tempest/Console/src/Commands/TailCommand.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Console\Commands;
6

7
use Fiber;
8
use Tempest\Console\ConsoleArgument;
9
use Tempest\Console\ConsoleCommand;
10

11
final readonly class TailCommand
12
{
13
    public function __construct(
×
14
        private TailDebugLogCommand $tailDebugLogCommand,
15
        private TailProjectLogCommand $tailProjectLogCommand,
16
        private TailServerLogCommand $tailServerLogCommand,
17
    ) {
18
    }
×
19

20
    #[ConsoleCommand(
×
21
        name: 'tail',
22
        description: 'Tail multiple logs',
23
    )]
24
    public function __invoke(
25
        #[ConsoleArgument(description: 'Include the project log', aliases: ['-p'])]
26
        ?bool $project = null,
27
        #[ConsoleArgument(description: 'Include the server log', aliases: ['-s'])]
28
        ?bool $server = null,
29
        #[ConsoleArgument(description: 'Include the debug log', aliases: ['-d'])]
30
        ?bool $debug = null,
31
    ): void {
32
        $shouldFilter = $project !== null || $server !== null || $debug !== null;
×
33

34
        /** @var array<array-key, \Tempest\Console\Commands\TailDebugLogCommand|\Tempest\Console\Commands\TailProjectLogCommand> $loggers */
35
        $loggers = array_filter([
×
UNCOV
36
            $shouldFilter === false || $project ? $this->tailProjectLogCommand : null,
×
UNCOV
37
            $shouldFilter === false || $server ? $this->tailServerLogCommand : null,
×
38
            $shouldFilter === false || $debug ? $this->tailDebugLogCommand : null,
×
39
        ]);
×
40

41
        /** @var Fiber[] $fibers */
42
        $fibers = [];
×
43

UNCOV
44
        foreach ($loggers as $key => $logger) {
×
45
            $fiber = new Fiber(fn () => $logger());
×
UNCOV
46
            $fibers[$key] = $fiber;
×
47
            $fiber->start();
×
48
        }
49

50
        while ($fibers !== []) {
×
UNCOV
51
            foreach ($fibers as $key => $fiber) {
×
UNCOV
52
                if ($fiber->isSuspended()) {
×
53
                    $fiber->resume();
×
54
                }
55

56
                if ($fiber->isTerminated()) {
×
UNCOV
57
                    unset($fibers[$key]);
×
58
                }
59
            }
60
        }
61
    }
62
}
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