CleanerCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Webhook\Bundle\Command;
6
7
8
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
/**
13
 * Class CleanerCommand
14
 *
15
 * @package Webhook\Bundle\Command
16
 */
17
class CleanerCommand extends ContainerAwareCommand
18
{
19
    protected function configure()
20
    {
21
        $this->setName('webhooks:clean');
22
    }
23
24
    /**
25
     * @param InputInterface $input
26
     * @param OutputInterface $output
27
     */
28
    protected function execute(InputInterface $input, OutputInterface $output)
29
    {
30
        // TODO: get as parameter
31
        $dateTime = new \DateTime(); // get as parameter
32
        $this->getContainer()->get('webhook.repository')->clearOutdated($dateTime);
33
    }
34
35
}