• 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/Commands/TailProjectLogCommand.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Console\Commands;
6

7
use Tempest\Console\Console;
8
use Tempest\Console\ConsoleCommand;
9
use Tempest\Console\Highlight\LogLanguage\LogLanguage;
10
use Tempest\Console\Output\TailReader;
11
use Tempest\Container\Tag;
12
use Tempest\Highlight\Highlighter;
13
use Tempest\Log\Channels\AppendLogChannel;
14
use Tempest\Log\LogConfig;
15

16
final readonly class TailProjectLogCommand
17
{
18
    public function __construct(
×
19
        private Console $console,
20
        private LogConfig $logConfig,
21
        #[Tag('console')]
22
        private Highlighter $highlighter,
UNCOV
23
    ) {}
×
24

UNCOV
25
    #[ConsoleCommand('tail:project', description: 'Tails the project log')]
×
26
    public function __invoke(): void
27
    {
UNCOV
28
        $appendLogChannel = null;
×
29

UNCOV
30
        foreach ($this->logConfig->channels as $channel) {
×
31
            if ($channel instanceof AppendLogChannel) {
×
32
                $appendLogChannel = $channel;
×
33

UNCOV
34
                break;
×
35
            }
36
        }
37

UNCOV
38
        if ($appendLogChannel === null) {
×
39
            $this->console->error('No AppendLogChannel registered');
×
40

UNCOV
41
            return;
×
42
        }
43

UNCOV
44
        $dir = pathinfo($appendLogChannel->getPath(), PATHINFO_DIRNAME);
×
45

UNCOV
46
        if (! is_dir($dir)) {
×
47
            mkdir($dir);
×
48
        }
49

UNCOV
50
        if (! file_exists($appendLogChannel->getPath())) {
×
51
            touch($appendLogChannel->getPath());
×
52
        }
53

UNCOV
54
        $this->console->header('Tailing project logs', "Reading <file='{$appendLogChannel->getPath()}'/>…");
×
55

UNCOV
56
        new TailReader()->tail(
×
57
            path: $appendLogChannel->getPath(),
×
58
            format: fn (string $text) => $this->highlighter->parse(
×
59
                $text,
×
60
                new LogLanguage(),
×
61
            ),
×
62
        );
×
63
    }
64
}
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