Passed
Push — master ( 34942f...100000 )
by Bartosz
01:00 queued 11s
created

Console/Command/PurgeWildcardCommand.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * File: PurgeWildcardCommand.php
4
 *
5
 * @author Maciej Sławik <[email protected]>
6
 * @copyright Copyright (C) 2019 Lizard Media (http://lizardmedia.pl)
7
 */
8
9
namespace LizardMedia\VarnishWarmer\Console\Command;
10
11
use Symfony\Component\Console\Input\InputInterface;
12
use Symfony\Component\Console\Input\InputOption;
13
use Symfony\Component\Console\Output\OutputInterface;
14
15
/**
16
 * Class PurgeWildcardCommand
17
 * @package LizardMedia\VarnishWarmer\Console\Command
18
 */
19 View Code Duplication
class PurgeWildcardCommand extends AbstractPurgeCommand
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
{
21
    /**
22
     * @var string
23
     */
24
    const CLI_COMMAND = 'lm-varnish:cache-purge-wildcard';
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    protected function configure()
30
    {
31
        $this->setName(self::CLI_COMMAND)
32
            ->setDescription('Purge: *; Regenerate: homepage, categories, products')
33
            ->addOption(
34
                self::STORE_VIEW_ID,
35
                null,
36
                InputOption::VALUE_OPTIONAL
37
            );
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    protected function execute(InputInterface $input, OutputInterface $output)
44
    {
45
        $this->varnishPurger->setStoreViewId((int) $input->getOption(self::STORE_VIEW_ID));
46
        $this->varnishPurger->purgeWildcard();
47
    }
48
}
49