Test Failed
Branch feature__set_up_scrutinizer (ea6624)
by Robin
06:04 queued 02:46
created

Container::updateDomain()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace App\Support\Dnsmasq;
4
5
6
class Container
7
{
8
    public function updateDomain($from, $to)
9
    {
10
        $filePath = config('porter.library_path').'/config/dnsmasq/dnsmasq.conf';
11
12
        $newConfig = preg_replace("/\/.{$from}\//", "/.{$to}/", file_get_contents($filePath));
13
14
        file_put_contents($filePath, $newConfig);
15
    }
16
}
17