• 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

60.0
/src/Tempest/Core/src/Commands/InstallCommand.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Core\Commands;
6

7
use Tempest\Console\Console;
8
use Tempest\Console\ConsoleCommand;
9
use Tempest\Console\HasConsole;
10
use Tempest\Console\Middleware\ForceMiddleware;
11
use Tempest\Container\Container;
12
use Tempest\Core\Installer;
13
use Tempest\Core\InstallerConfig;
14

15
use function Tempest\Support\arr;
16

17
final readonly class InstallCommand
18
{
19
    use HasConsole;
20

21
    public function __construct(
6✔
22
        private InstallerConfig $installerConfig,
23
        private Console $console,
24
        private Container $container,
25
    ) {
26
    }
6✔
27

28
    #[ConsoleCommand(name: 'install', description: 'Applies the specified installer', middleware: [ForceMiddleware::class])]
6✔
29
    public function __invoke(?string $installer = null): void
30
    {
31
        $installer = $this->resolveInstaller($installer);
6✔
32

33
        if ($installer === null) {
6✔
UNCOV
34
            $this->error('Installer not found');
×
35

UNCOV
36
            return;
×
37
        }
38

39
        if (! $this->confirm("Running the <em>{$installer->name}</em> installer, continue?", default: true)) {
6✔
UNCOV
40
            $this->error('Aborted.');
×
41

UNCOV
42
            return;
×
43
        }
44

45
        $installer->install();
5✔
46
    }
47

48
    private function resolveInstaller(?string $search): ?Installer
6✔
49
    {
50
        /** @var Installer[]|\Tempest\Support\Arr\ImmutableArray $installers */
51
        $installers = arr($this->installerConfig->installers)
6✔
52
            ->map(fn (string $installerClass) => $this->container->get($installerClass));
6✔
53

54
        if (! $search) {
6✔
UNCOV
55
            $search = $this->ask(
×
56
                question: 'Please choose an installer',
×
57
                options: $installers->mapWithKeys(fn (Installer $installer) => yield $installer::class => $installer->name)->toArray(),
×
58
            );
×
59
        }
60

61
        return $installers->first(fn (Installer $installer) => $installer::class === $search || $installer->name === $search);
6✔
62
    }
63
}
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