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...
11
{
12
/**
13
* @var ProcessRunner
14
*/
15
private $processRunner;
16
/**
17
* @var UserInteraction
18
*/
19
private $userInteraction;
20
21
/**
22
* @param UserInteraction $userInteraction
23
* @param ProcessRunner $processRunner
24
*/
25
public function __construct(UserInteraction $userInteraction, ProcessRunner $processRunner)
26
{
27
$this->userInteraction = $userInteraction;
28
$this->processRunner = $processRunner;
29
}
30
31
/**
32
* {@inheritdoc}
33
*/
34
public function getName()
35
{
36
return 'routing';
37
}
38
39
/**
40
* {@inheritdoc}
41
*/
42
public function run()
43
{
44
if (!$this->isUsingDnsDockDnsServer()) {
45
$this->userInteraction->writeTitle('Configure routing for direct Docker containers access');
46
47
$this->processRunner->run("sudo sed -i -e '1inameserver ".DnsDock::IP."\\' /etc/resolv.conf");
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.