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

tempestphp / tempest-framework / 14049246919

24 Mar 2025 09:42PM UTC coverage: 79.353% (-0.04%) from 79.391%
14049246919

push

github

web-flow
feat(support): support array parameters in string manipulations (#1073)

48 of 48 new or added lines in 2 files covered. (100.0%)

735 existing lines in 126 files now uncovered.

10492 of 13222 relevant lines covered (79.35%)

90.78 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
    ) {}
1✔
19

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

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

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

UNCOV
36
            return;
×
37
        }
38

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

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

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