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

Remote::getMTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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