Completed
Push — master ( 835840...ce2316 )
by Pablo
02:59
created

PhpUnitTool   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 53
loc 53
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A isRandomMode() 4 4 1
A getOptions() 4 4 1
A getErrorMessage() 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\PhpUnit\Contract\Command;
4
5
use Bruli\EventBusBundle\CommandBus\CommandInterface;
6
7 View Code Duplication
class PhpUnitTool 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 bool
11
     */
12
    private $randomMode;
13
    /**
14
     * @var null|string
15
     */
16
    private $options;
17
    /**
18
     * @var string
19
     */
20
    private $errorMessage;
21
22
    /**
23
     * PhpUnitToolCommand constructor.
24
     *
25
     * @param bool        $randomMode
26
     * @param string|null $options
27
     * @param string      $errorMessage
28
     */
29 4
    public function __construct($randomMode, $options, $errorMessage)
30
    {
31 4
        $this->randomMode = $randomMode;
32 4
        $this->options = $options;
33 4
        $this->errorMessage = $errorMessage;
34 4
    }
35
36
    /**
37
     * @return bool
38
     */
39 2
    public function isRandomMode()
40
    {
41 2
        return $this->randomMode;
42
    }
43
44
    /**
45
     * @return null|string
46
     */
47 2
    public function getOptions()
48
    {
49 2
        return $this->options;
50
    }
51
52
    /**
53
     * @return string
54
     */
55 2
    public function getErrorMessage()
56
    {
57 2
        return $this->errorMessage;
58
    }
59
}
60