Test Failed
Push — feature-laravel-5.4 ( edfc13...468b78 )
by Kirill
03:20
created

GitHubConfigRepository::getBranch()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of laravel.su package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace App\Services\GitHub;
10
11
use Illuminate\Config\Repository;
12
13
/**
14
 * Class GitHubConfigRepository.
15
 */
16
class GitHubConfigRepository extends Repository
17
{
18
    /**
19
     * GitHubConfigRepository constructor.
20
     * @param Repository $original
21
     */
22
    public function __construct(Repository $original)
23
    {
24
        $connection = $original->get('docs.default');
25
        $config = $original->get('docs.connections.' . $connection);
26
27
        parent::__construct(array_merge($config, [
28
29
        ]));
30
    }
31
32
    /**
33
     * @return array
34
     */
35
    public function values(): array
36
    {
37
        return [
38
            $this->getOrg(),
39
            $this->getRepo(),
40
            $this->getBranch()
41
        ];
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getOrg(): string
48
    {
49
        return $this->get('org', '');
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getRepo(): string
56
    {
57
        return $this->get('repo', '');
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getBranch(): string
64
    {
65
        return $this->get('branch', '');
66
    }
67
}