Completed
Push — development ( 4cbc56...9c238f )
by Thomas
27s
created

JournaldPostfixLogsCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 8 8 1
A execute() 5 5 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/***************************************************************************
3
 * For license information see LICENSE.md
4
 ***************************************************************************/
5
6
namespace AppBundle\Command;
7
8
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12 View Code Duplication
class JournaldPostfixLogsCommand extends ContainerAwareCommand
0 ignored issues
show
Duplication introduced by
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...
13
{
14
    const COMMAND_NAME = 'postfix:processing-logs';
15
16
    /**
17
     * @return void
18
     * @throws \Symfony\Component\Console\Exception\InvalidArgumentException
19
     */
20
    protected function configure()
21
    {
22
        parent::configure();
23
24
        $this
25
            ->setName(self::COMMAND_NAME)
26
            ->setDescription('process postfix logs for support');
27
    }
28
29
    /**
30
     * @param \Symfony\Component\Console\Input\InputInterface $input
31
     * @param \Symfony\Component\Console\Output\OutputInterface $output
32
     *
33
     * @return int|null
0 ignored issues
show
Coding Style introduced by
Function return type is not void, but function has no return statement
Loading history...
34
     */
35
    protected function execute(InputInterface $input, OutputInterface $output)
36
    {
37
        $journal = $this->getContainer()->get('oc_bundle.postfix.journal_logs');
38
        $journal->processJournalLogs();
39
    }
40
}
41