Completed
Pull Request — master (#140)
by Vitaly
04:25
created

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