• 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

90.48
/src/Tempest/Cache/src/CacheClearCommand.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Cache;
6

7
use Tempest\Console\ConsoleCommand;
8
use Tempest\Console\HasConsole;
9
use Tempest\Container\Container;
10

11
final readonly class CacheClearCommand
12
{
13
    use HasConsole;
14

15
    public function __construct(
1✔
16
        private CacheConfig $cacheConfig,
17
        private Container $container,
18
    ) {
19
    }
1✔
20

21
    #[ConsoleCommand(name: 'cache:clear', description: 'Clears all or specified caches')]
1✔
22
    public function __invoke(bool $all = false): void
23
    {
24
        $caches = $this->cacheConfig->caches;
1✔
25

26
        if ($all === false) {
1✔
27
            $caches = $this->ask(
1✔
28
                question: 'Which caches do you want to clear?',
1✔
29
                options: $this->cacheConfig->caches,
1✔
30
                multiple: true,
1✔
31
            );
1✔
32
        }
33

34
        if (count($caches) === 0) {
1✔
UNCOV
35
            $this->console->info('No cache selected.');
×
36

UNCOV
37
            return;
×
38
        }
39

40
        $this->console->header('Clearing caches');
1✔
41

42
        foreach ($caches as $cacheClass) {
1✔
43
            /** @var Cache $cache */
44
            $cache = $this->container->get($cacheClass);
1✔
45
            $cache->clear();
1✔
46

47
            $this->console->keyValue(
1✔
48
                key: $cacheClass,
1✔
49
                value: "<style='bold fg-green'>CLEARED</style>",
1✔
50
            );
1✔
51
        }
52
    }
53
}
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