• 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/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,
23
    ) {
24
    }
×
25

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

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

35
                break;
×
36
            }
37
        }
38

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

42
            return;
×
43
        }
44

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

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

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

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

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