GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 64f5bb...5f2d07 )
by Anton
02:44
created

Template::getParametersForReplace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/* (c) Anton Medvedev <[email protected]>
3
 *
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Deployer\Initializer\Template;
9
10
/**
11
 * Abstract template for create deployer configuration.
12
 *
13
 * @author Vitaliy Zhuk <[email protected]>
14
 * @author Anton Medvedev <[email protected]>
15
 */
16
abstract class Template implements TemplateInterface
17
{
18
    /**
19
     * {@inheritDoc}
20
     */
21 1
    public function initialize($filePath, $params)
22
    {
23 1
        $params = array_merge([
24 1
            'repository' => '[email protected]:username/repository.git',
25
            'allow_anonymous_stats' => true,
26
        ], $params);
27
28 1
        $content = $this->getTemplateContent($params);
29 1
        file_put_contents($filePath, $content);
30 1
    }
31
32
    /**
33
     * Get content of template.
34
     *
35
     * @param array $params
36
     * @return string
37
     */
38
    abstract protected function getTemplateContent($params);
39
}
40