Completed
Pull Request — master (#140)
by
unknown
05:09
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
use phpbu\App\Backup\Sync;
7
8
class Remote implements File
9
{
10
    /**
11
     * File size
12
     *
13
     * @var int
14
     */
15
    protected $size;
16
17
    /**
18
     * Filename
19
     *
20
     * @var string
21
     */
22
    protected $filename;
23
24
    /**
25
     * Full path with filename
26
     *
27
     * @var string
28
     */
29
    protected $pathname;
30
31
    /**
32
     * File's last modified unix timestamp
33
     *
34
     * @var int
35
     */
36
    protected $lastModified;
37
38
    /**
39
     * Return the filesize.
40
     *
41
     * @return integer
42
     */
43 1
    public function getSize(): int
44
    {
45 1
        return $this->size;
46
    }
47
48
    /**
49
     * Return the filename.
50
     *
51
     * @return string
52
     */
53 1
    public function getFilename(): string
54
    {
55 1
        return $this->filename;
56
    }
57
58
    /**
59
     * Return the full path and filename.
60
     *
61
     * @return string
62
     */
63 1
    public function getPathname(): string
64
    {
65 1
        return $this->pathname;
66
    }
67
68
    /**
69
     * Return last modified date as unix timestamp.
70
     *
71
     * @return integer
72
     */
73 1
    public function getMTime(): int
74
    {
75 1
        return $this->lastModified;
76
    }
77
78
    /**
79
     * Return whether the file is writable or not.
80
     *
81
     * @return boolean
82
     */
83
    public function isWritable(): bool
84
    {
85
        return true;
86
    }
87
88
    /**
89
     * Deletes the file.
90
     *
91
     * @throws \phpbu\App\Exception
92
     */
93
    public function unlink()
94
    {
95
        throw new \phpbu\App\Exception("Method must be overrided in proper file class");
96
    }
97
}