Completed
Push — master ( 6aac25...fc5b3c )
by Sebastian
04:08 queued 01:04
created

Remote   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 87
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 87
ccs 8
cts 10
cp 0.8
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
unlink() 0 1 ?
A getSize() 0 4 1
A getFilename() 0 4 1
A getPathname() 0 4 1
A getMTime() 0 4 1
A isWritable() 0 4 1
1
<?php
2
3
namespace phpbu\App\Backup\File;
4
5
use phpbu\App\Backup\File;
6
7
/**
8
 * Remote file class.
9
 *
10
 * @package    phpbu
11
 * @subpackage Backup
12
 * @author     Sebastian Feldmann <[email protected]>
13
 * @author     Vitaly Baev <[email protected]>
14
 * @copyright  Sebastian Feldmann <[email protected]>
15
 * @license    https://opensource.org/licenses/MIT The MIT License (MIT)
16
 * @link       http://phpbu.de/
17
 * @since      Class available since Release 5.1.0
18
 */
19
abstract class Remote implements File
20
{
21
    /**
22
     * File size
23
     *
24
     * @var int
25
     */
26
    protected $size;
27
28
    /**
29
     * Filename
30
     *
31
     * @var string
32
     */
33
    protected $filename;
34
35
    /**
36
     * Full path with filename
37
     *
38
     * @var string
39
     */
40
    protected $pathname;
41
42
    /**
43
     * File's last modified unix timestamp
44
     *
45
     * @var int
46
     */
47
    protected $lastModified;
48
49
    /**
50
     * Return the filesize.
51
     *
52
     * @return integer
53
     */
54 4
    public function getSize(): int
55
    {
56 4
        return $this->size;
57
    }
58
59
    /**
60
     * Return the filename.
61
     *
62
     * @return string
63
     */
64 8
    public function getFilename(): string
65
    {
66 8
        return $this->filename;
67
    }
68
69
    /**
70
     * Return the full path and filename.
71
     *
72
     * @return string
73
     */
74 4
    public function getPathname(): string
75
    {
76 4
        return $this->pathname;
77
    }
78
79
    /**
80
     * Return last modified date as unix timestamp.
81
     *
82
     * @return integer
83
     */
84 4
    public function getMTime(): int
85
    {
86 4
        return $this->lastModified;
87
    }
88
89
    /**
90
     * Return whether the file is writable or not.
91
     *
92
     * @return boolean
93
     */
94
    public function isWritable(): bool
95
    {
96
        return true;
97
    }
98
99
    /**
100
     * Deletes the file.
101
     *
102
     * @throws \phpbu\App\Exception
103
     */
104
    abstract public function unlink();
105
}
106