PurgeWildcardCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * File: PurgeWildcardCommand.php
7
 *
8
 * @author Maciej Sławik <[email protected]>
9
 * @copyright Copyright (C) 2019 Lizard Media (http://lizardmedia.pl)
10
 */
11
12
namespace LizardMedia\VarnishWarmer\Console\Command;
13
14
use Symfony\Component\Console\Input\InputInterface;
15
use Symfony\Component\Console\Input\InputOption;
16
use Symfony\Component\Console\Output\OutputInterface;
17
18
/**
19
 * Class PurgeWildcardCommand
20
 * @package LizardMedia\VarnishWarmer\Console\Command
21
 */
22
class PurgeWildcardCommand extends AbstractPurgeCommand
23
{
24
    /**
25
     * @var string
26
     */
27
    public const CLI_COMMAND = 'lm-varnish:cache-purge-wildcard';
28
29
    /**
30
     * @return void
31
     */
32
    protected function configure(): void
33
    {
34
        $this->setName(self::CLI_COMMAND)
35
            ->setDescription('Purge: *; Regenerate: homepage, categories, products')
36
            ->addOption(
37
                self::STORE_VIEW_ID,
38
                null,
39
                InputOption::VALUE_OPTIONAL
40
            );
41
    }
42
43
    /**
44
     * @param InputInterface $input
45
     * @param OutputInterface $output
46
     * @return void
47
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
48
     */
49
    protected function execute(InputInterface $input, OutputInterface $output): void
50
    {
51
        $this->passStoreViewIfSet($input);
52
        $this->varnishActionManager->purgeWildcard();
53
    }
54
}
55