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

Remote   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 97
ccs 0
cts 24
cp 0
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
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
A unlink() 0 4 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
     * 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
}