CleanerCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 4 1
A execute() 0 6 1
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
}