Completed
Pull Request — master (#140)
by
unknown
05:29
created

Collector   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 42
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
getBackupFiles() 0 1 ?
1
<?php
2
3
namespace phpbu\App\Backup;
4
5
use phpbu\App\Util\Str;
6
7
abstract class Collector
8
{
9
    /**
10
     * Backup target
11
     *
12
     * @var \phpbu\App\Backup\Target
13
     */
14
    protected $target;
15
16
    /**
17
     * Target filename regex
18
     *
19
     * @var string
20
     */
21
    protected $fileRegex;
22
23
    /**
24
     * Collection cache
25
     *
26
     * @var \phpbu\App\Backup\File[]
27
     */
28
    protected $files;
29
30
    /**
31
     * Setting up
32
     *
33
     * @param \phpbu\App\Backup\Target $target
34
     */
35
    public function setUp(Target $target)
36
    {
37
        $this->target = $target;
38
        $this->fileRegex = Str::datePlaceholdersToRegex($target->getFilenameRaw());
39
        $this->files     = [];
40
    }
41
42
    /**
43
     * Get all created backups.
44
     *
45
     * @return \phpbu\App\Backup\File[]
46
     */
47
    abstract public function getBackupFiles() : array;
48
}