Completed
Push — master ( bc803d...ad38cf )
by Sebastian
04:42
created

Abstraction::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace phpbu\App\Backup\Target\Compression;
3
4
use phpbu\App\Backup\Target\Compression;
5
6
/**
7
 * Abstraction
8
 *
9
 * @package    phpbu
10
 * @subpackage Backup
11
 * @author     Sebastian Feldmann <[email protected]>
12
 * @copyright  Sebastian Feldmann <[email protected]>
13
 * @license    https://opensource.org/licenses/MIT The MIT License (MIT)
14
 * @link       http://phpbu.de/
15
 * @since      Class available since Release 3.2.1
16
 */
17
abstract class Abstraction implements Compression
18
{
19
    /**
20
     * Command name
21
     *
22
     * @var string
23
     */
24
    protected $cmd;
25
26
    /**
27
     * Path to command binary
28
     *
29
     * @var string
30
     */
31
    protected $path;
32
33
    /**
34
     * Suffix for compressed files
35
     *
36
     * @var string
37
     */
38
    protected $suffix;
39
40
    /**
41
     * MIME type for compressed files
42
     *
43
     * @var string
44
     */
45
    protected $mimeType;
46
47
    /**
48
     * Can this compression compress piped output
49
     *
50
     * @var bool
51
     */
52
    protected $pipeable;
53
54
    /**
55
     * Constructor.
56
     *
57
     * @param string $path
58
     */
59
    public function __construct($path = null)
60
    {
61
        $this->path = $path;
62
    }
63
64
    /**
65
     * Return the cli command.
66
     *
67
     * @return string
68
     */
69
    public function getCommand()
70
    {
71
        return $this->cmd;
72
    }
73
74
    /**
75
     * Path getter.
76
     *
77
     * @return string
78
     */
79
    public function getPath()
80
    {
81
        return $this->path;
82
    }
83
84
    /**
85
     * Returns the compressor suffix e.g. 'bz2'.
86
     *
87
     * @return string
88
     */
89
    public function getSuffix()
90
    {
91
        return $this->suffix;
92
    }
93
94
    /**
95
     * Is the compression app pipeable.
96
     *
97
     * @return bool
98
     */
99
    public function isPipeable()
100
    {
101
        return $this->pipeable;
102
    }
103
104
    /**
105
     * Returns the compressor mime type.
106
     *
107
     * @return string
108
     */
109
    public function getMimeType()
110
    {
111
        return $this->mimeType;
112
    }
113
}
114