Config   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 21
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getReleaseBranch() 0 3 1
A shouldUsePrefix() 0 3 1
A __construct() 0 7 2
1
<?php
2
3
/*
4
 * This file is part of the egabor/composer-release-plugin package.
5
 *
6
 * (c) Gábor Egyed <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace egabor\Composer\ReleasePlugin;
13
14
use Composer\Package\RootPackageInterface;
15
16
final class Config
17
{
18
    private $config;
19
20 2
    public function __construct(RootPackageInterface $package)
21
    {
22 2
        $extra = $package->getExtra();
23 2
        $this->config = array_replace([
24 2
            'use-prefix' => true,
25
            'release-branch' => 'master',
26 2
        ], isset($extra['egabor-release']) ? $extra['egabor-release'] : []);
27 2
    }
28
29 2
    public function shouldUsePrefix()
30
    {
31 2
        return $this->config['use-prefix'];
32
    }
33
34 2
    public function getReleaseBranch()
35
    {
36 2
        return $this->config['release-branch'];
37
    }
38
}
39