Constant::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/*
3
 * This file is part of the Backup package, an RunOpenCode project.
4
 *
5
 * (c) 2015 RunOpenCode
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * This project is fork of "kbond/php-backup", for full credits info, please
11
 * view CREDITS file that was distributed with this source code.
12
 */
13
namespace RunOpenCode\Backup\Namer;
14
15
use RunOpenCode\Backup\Contract\NamerInterface;
16
17
/**
18
 * Class Constant
19
 *
20
 * Namer that always names backup with same name.
21
 *
22
 * @package RunOpenCode\Backup\Namer
23
 */
24
final class Constant implements NamerInterface
25
{
26
    private $name;
27
28 30
    public function __construct($name = 'backup')
29
    {
30 30
        $this->name = $name;
31 30
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 8
    public function getName()
37
    {
38 8
        return $this->name;
39
    }
40
}
41