Completed
Push — master ( 8ee32e...efc44e )
by Pablo
02:33
created

ComposerTool   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 0
dl 39
loc 39
rs 10
ccs 8
cts 8
cp 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1
A getErrorMessage() 4 4 1
A getFiles() 4 4 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
namespace PhpGitHooks\Module\Composer\Contract\Command;
4
5
use Bruli\EventBusBundle\CommandBus\CommandInterface;
6
7 View Code Duplication
class ComposerTool implements CommandInterface
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...
8
{
9
    /**
10
     * @var array
11
     */
12
    private $files;
13
    /**
14
     * @var string
15
     */
16
    private $errorMessage;
17
18
    /**
19
     * ComposerToolCommand constructor.
20
     *
21
     * @param array  $files
22
     * @param string $errorMessage
23
     */
24 4
    public function __construct(array $files, $errorMessage)
25
    {
26 4
        $this->files = $files;
27 4
        $this->errorMessage = $errorMessage;
28 4
    }
29
30
    /**
31
     * @return string
32
     */
33 3
    public function getErrorMessage()
34
    {
35 3
        return $this->errorMessage;
36
    }
37
38
    /**
39
     * @return array
40
     */
41 3
    public function getFiles()
42
    {
43 3
        return $this->files;
44
    }
45
}
46