• 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

11.11
/src/Tempest/Console/src/ConsoleApplication.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Console;
6

7
use Tempest\Console\Actions\ExecuteConsoleCommand;
8
use Tempest\Console\Input\ConsoleArgumentBag;
9
use Tempest\Container\Container;
10
use Tempest\Core\AppConfig;
11
use Tempest\Core\Application;
12
use Tempest\Core\Kernel;
13
use Tempest\Core\Tempest;
14
use Tempest\Log\Channels\AppendLogChannel;
15
use Tempest\Log\LogConfig;
16
use Throwable;
17

18
use function Tempest\Support\path;
19

20
final readonly class ConsoleApplication implements Application
21
{
22
    public function __construct(
4✔
23
        private Container $container,
24
        private AppConfig $appConfig,
25
        private ConsoleArgumentBag $argumentBag,
26
    ) {
27
    }
4✔
28

29
    /** @param \Tempest\Discovery\DiscoveryLocation[] $discoveryLocations */
UNCOV
30
    public static function boot(
×
31
        string $name = 'Tempest',
32
        ?string $root = null,
33
        array $discoveryLocations = [],
34
    ): self {
UNCOV
35
        $container = Tempest::boot($root, $discoveryLocations);
×
36

UNCOV
37
        $application = $container->get(ConsoleApplication::class);
×
38

39
        // Application-specific config
40
        $consoleConfig = $container->get(ConsoleConfig::class);
×
UNCOV
41
        $consoleConfig->name = $name;
×
42

UNCOV
43
        return $application;
×
44
    }
45

46
    public function run(): void
×
47
    {
48
        try {
49
            $exitCode = $this->container->get(ExecuteConsoleCommand::class)($this->argumentBag->getCommandName());
×
50

UNCOV
51
            $exitCode = is_int($exitCode) ? $exitCode : $exitCode->value;
×
52

UNCOV
53
            if ($exitCode < 0 || $exitCode > 255) {
×
UNCOV
54
                throw new InvalidExitCode($exitCode);
×
55
            }
56

UNCOV
57
            $this->container->get(Kernel::class)->shutdown($exitCode);
×
58
        } catch (Throwable $throwable) {
×
UNCOV
59
            foreach ($this->appConfig->errorHandlers as $exceptionHandler) {
×
60
                $exceptionHandler->handleException($throwable);
×
61
            }
62

63
            throw $throwable;
×
64
        }
65
    }
66
}
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