These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
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
|
|||
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 |
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.