• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tempestphp / tempest-framework / 14035658168

24 Mar 2025 12:47PM UTC coverage: 79.345%. First build
14035658168

Pull #1069

github

web-flow
Merge c255adb6a into 412c2d0a5
Pull Request #1069: feat(view): add `view:clear` command

0 of 9 new or added lines in 1 file covered. (0.0%)

10483 of 13212 relevant lines covered (79.34%)

91.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Tempest/View/src/Commands/ClearViewCacheCommand.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\View\Commands;
6

7
use Tempest\Cache\CouldNotClearCache;
8
use Tempest\Console\ConsoleCommand;
9
use Tempest\Console\HasConsole;
10
use Tempest\Container\Container;
11
use Tempest\View\ViewCache;
12

13
final readonly class ClearViewCacheCommand
14
{
15
    use HasConsole;
16

NEW
17
    public function __construct(
×
18
        private Container $container,
19
    ) {
NEW
20
    }
×
21

NEW
22
    #[ConsoleCommand(name: 'view:clear', description: 'Clears the view cache')]
×
23
    public function __invoke(): void
24
    {
NEW
25
        $this->console->header('Clearing the view cache');
×
26

27
        try {
NEW
28
            $this->container->get(ViewCache::class)->clear();
×
NEW
29
            $value = "<style='bold fg-green'>CLEARED</style>";
×
NEW
30
        } catch (CouldNotClearCache) {
×
NEW
31
            $value = "<style='bold fg-red'>FAILEd</style>";
×
32
        }
33

NEW
34
        $this->console->keyValue(key: ViewCache::class, value: $value);
×
35
    }
36
}
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