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

valkyrjaio / valkyrja / 16015663376

02 Jul 2025 03:52AM UTC coverage: 38.284% (-5.8%) from 44.066%
16015663376

push

github

web-flow
Merge pull request #38 from valkyrjaio/config-update

Config update

156 of 338 new or added lines in 42 files covered. (46.15%)

679 existing lines in 118 files now uncovered.

4122 of 10767 relevant lines covered (38.28%)

9.53 hits per line

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

0.0
/src/Valkyrja/Application/Command/ClearCacheCommand.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the Valkyrja Framework package.
7
 *
8
 * (c) Melech Mizrachi <melechmizrachi@gmail.com>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13

14
namespace Valkyrja\Application\Command;
15

16
use Valkyrja\Application\Env;
17
use Valkyrja\Cli\Interaction\Factory\Contract\OutputFactory;
18
use Valkyrja\Cli\Interaction\Message\Banner;
19
use Valkyrja\Cli\Interaction\Message\Message;
20
use Valkyrja\Cli\Interaction\Message\SuccessMessage;
21
use Valkyrja\Cli\Interaction\Output\Contract\Output;
22
use Valkyrja\Cli\Routing\Attribute\Command as CommandAttribute;
23

24
/**
25
 * Class ClearCacheCommand.
26
 *
27
 * @author Melech Mizrachi
28
 */
29
class ClearCacheCommand
30
{
31
    #[CommandAttribute(
UNCOV
32
        name: 'config:clear-cache',
×
UNCOV
33
        description: 'Clear config cache',
×
UNCOV
34
        helpText: new Message('A command to clear the config cache.'),
×
UNCOV
35
    )]
×
36
    public function run(Env $env, OutputFactory $outputFactory): Output
37
    {
38
        /** @var non-empty-string $cacheFilePath */
NEW
39
        $cacheFilePath = $env::APP_CACHE_FILE_PATH;
×
40

41
        // If the cache file already exists, delete it
42
        if (is_file($cacheFilePath)) {
×
43
            unlink($cacheFilePath);
×
44
        }
45

46
        return $outputFactory
×
47
            ->createOutput()
×
48
            ->withMessages(
×
49
                new Banner(new SuccessMessage('Application cache cleared successfully.'))
×
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