Completed
Pull Request — master (#140)
by
unknown
03:00
created

Remote::getFilename()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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
     * Sync class
12
     *
13
     * @var Sync
14
     */
15
    protected $sync;
16
17
    /**
18
     * File size
19
     *
20
     * @var int
21
     */
22
    protected $size;
23
24
    /**
25
     * Filename
26
     *
27
     * @var string
28
     */
29
    protected $filename;
30
31
    /**
32
     * Full path with filename
33
     *
34
     * @var string
35
     */
36
    protected $pathname;
37
38
    /**
39
     * File's last modified unix timestamp
40
     *
41
     * @var int
42
     */
43
    protected $lastModified;
44
45
    /**
46
     * Return the filesize.
47
     *
48
     * @return integer
49
     */
50
    public function getSize(): int
51
    {
52
        return $this->size;
53
    }
54
55
    /**
56
     * Return the filename.
57
     *
58
     * @return string
59
     */
60
    public function getFilename(): string
61
    {
62
        return $this->filename;
63
    }
64
65
    /**
66
     * Return the full path and filename.
67
     *
68
     * @return string
69
     */
70
    public function getPathname(): string
71
    {
72
        return $this->pathname;
73
    }
74
75
    /**
76
     * Return last modified date as unix timestamp.
77
     *
78
     * @return integer
79
     */
80
    public function getMTime(): int
81
    {
82
        return $this->lastModified;
83
    }
84
85
    /**
86
     * Return whether the file is writable or not.
87
     *
88
     * @return boolean
89
     */
90
    public function isWritable(): bool
91
    {
92
        return true;
93
    }
94
95
    /**
96
     * Deletes the file.
97
     *
98
     * @throws \phpbu\App\Exception
99
     */
100
    public function unlink()
101
    {
102
        throw new \phpbu\App\Exception("Method must be overrided in proper file class");
103
    }
104
}