Completed
Push — master ( 05902f...9e6322 )
by mark
01:41 queued 11s
created

AbstractTemplateCreation   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 62
Duplicated Lines 14.52 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 0
dl 9
loc 62
ccs 9
cts 11
cp 0.8182
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 9 9 3
A getInput() 0 4 1
A setInput() 0 6 1
A getOutput() 0 4 1
A setOutput() 0 6 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
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace Phinx\Migration;
9
10
use Symfony\Component\Console\Input\InputInterface;
11
use Symfony\Component\Console\Output\OutputInterface;
12
13
abstract class AbstractTemplateCreation implements CreationInterface
14
{
15
    /**
16
     * @var \Symfony\Component\Console\Input\InputInterface
17
     */
18
    protected $input;
19
20
    /**
21
     * @var \Symfony\Component\Console\Output\OutputInterface
22
     */
23
    protected $output;
24
25
    /**
26
     * @param \Symfony\Component\Console\Input\InputInterface|null $input Input
27
     * @param \Symfony\Component\Console\Output\OutputInterface|null $output Output
28
     */
29 View Code Duplication
    public function __construct(InputInterface $input = null, OutputInterface $output = null)
0 ignored issues
show
Duplication introduced by
This method 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...
30
    {
31
        if ($input !== null) {
32
            $this->setInput($input);
33
        }
34
        if ($output !== null) {
35
            $this->setOutput($output);
36
        }
37
    }
38
39
    /**
40
     * @inheritDoc
41
     */
42
    public function getInput()
43
    {
44
        return $this->input;
45
    }
46
47
    /**
48
     * @inheritDoc
49
     */
50
    public function setInput(InputInterface $input)
51
    {
52 6
        $this->input = $input;
53
54 6
        return $this;
55 6
    }
56 6
57 6
    /**
58 6
     * @inheritDoc
59 6
     */
60 6
    public function getOutput()
61
    {
62
        return $this->output;
63
    }
64
65
    /**
66
     * @inheritDoc
67
     */
68
    public function setOutput(OutputInterface $output)
69
    {
70
        $this->output = $output;
71
72
        return $this;
73 6
    }
74
}
75