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

Collector::isMatchingDirectory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
crap 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
}