Completed
Pull Request — master (#81)
by
unknown
01:42
created

GzipCompressor   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 23
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCompressorCommand() 0 6 2
A getExtension() 0 4 1
A setLevel() 0 4 1
1
<?php
2
3
namespace Spatie\DbDumper\Compressors;
4
5
class GzipCompressor implements Compressor
6
{
7
    protected $level = null;
8
9
    protected $extension = '.gz';
10
11
    public function getCompressorCommand()
12
    {
13
        $level = $this->level ? " -{$this->level}" : '';
14
15
        return 'gzip' . $level;
16
    }
17
18
    public function getExtension()
19
    {
20
        return $this->extension;
21
    }
22
23
    public function setLevel(string $level)
24
    {
25
        $this->level = $level;
26
    }
27
}
28