Failed Conditions
Push — master ( ac05b5...2858d3 )
by Keoghan
02:49
created

Windows   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 40%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 21
ccs 2
cts 5
cp 0.4
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A flushDns() 0 4 1
A getUserHomePath() 0 3 1
1
<?php
2
3
namespace App\Support\Mechanics;
4
5
class Windows extends Untrained
6
{
7
    /**
8
     * Return the User's home directory path
9
     *
10
     * @return string
11
     */
12 1
    public function getUserHomePath()
13
    {
14 1
        return $this->serverBag->get('HOME') ?? $this->serverBag->get('HOMEDRIVE').$this->serverBag->get('HOMEPATH');
15
    }
16
17
    /**
18
     * Flush the host system DNS cache
19
     *
20
     * @return void
21
     */
22
    public function flushDns()
23
    {
24
        $this->consoleWriter->info('Flushing DNS.');
25
        $this->cli->passthru('ipconfig /flushdns');
26
    }
27
}
28