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

GzipCompressor::setLevel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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