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
Pull Request — master (#1061)
by Maxim
04:23 queued 01:35
created

CommonTemplate   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 61
ccs 0
cts 45
cp 0
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTemplateContent() 0 55 1
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
 * Generate a common (base) deployer configuration
12
 *
13
 * @author Vitaliy Zhuk <[email protected]>
14
 * @author Anton Medvedev <[email protected]>
15
 */
16
class CommonTemplate extends Template
17
{
18
    /**
19
     * {@inheritDoc}
20
     */
21
    protected function getTemplateContent()
22
    {
23
        return <<<PHP
24
<?php
25
namespace Deployer;
26
require 'recipe/common.php';
27
28
// Configuration
29
30
set('ssh_type', 'native');
31
set('ssh_multiplexing', true);
32
33
set('repository', '[email protected]:username/repository.git');
34
set('shared_files', []);
35
set('shared_dirs', []);
36
set('writable_dirs', []);
37
38
// Servers
39
40
server('production', 'domain.com')
41
    ->user('username')
42
    ->identityFile()
43
    ->set('deploy_path', '/var/www/domain.com');
44
45
46
// Tasks
47
48
desc('Restart PHP-FPM service');
49
task('php-fpm:restart', function () {
50
    // The user must have rights for restart service
51
    // /etc/sudoers: username ALL=NOPASSWD:/bin/systemctl restart php-fpm.service
52
    run('sudo systemctl restart php-fpm.service');
53
});
54
after('deploy:symlink', 'php-fpm:restart');
55
56
desc('Deploy your project');
57
task('deploy', [
58
    'deploy:prepare',
59
    'deploy:lock',
60
    'deploy:release',
61
    'deploy:update_code',
62
    'deploy:shared',
63
    'deploy:writable',
64
    'deploy:vendors',
65
    'deploy:clear_paths',
66
    'deploy:symlink',
67
    'deploy:unlock',
68
    'cleanup',
69
    'success'
70
]);
71
72
// [Optional] if deploy fails automatically unlock.
73
after('deploy:failed', 'deploy:unlock');
74
PHP;
75
    }
76
}
77