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

Collector   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

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