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.

Console   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
lcom 0
cbo 4
dl 0
loc 47
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A updateDatabaseSchema() 0 4 1
A execute() 0 4 1
B prepare() 0 23 5
1
<?php
2
3
namespace Application\Tool;
4
5
use Symfony\Component\Console\Output\OutputInterface;
6
7
/**
8
 * @author Borut Balažek <[email protected]>
9
 */
10
class Console
11
{
12
    /**
13
     * @param string $command
14
     *
15
     * @return string|null
16
     */
17
    public static function execute($command = '')
18
    {
19
        return shell_exec($command);
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    public static function updateDatabaseSchema()
26
    {
27
        echo self::execute('php bin/console orm:schema-tool:update --force --dump-sql --complete');
28
    }
29
30
    /**
31
     * @param OutputInterface $output
32
     */
33
    public static function prepare(OutputInterface $output = null)
34
    {
35
        if ($output) {
36
            $output->writeln('<info>Preparing storage...</info>');
37
        }
38
        Storage::prepare();
39
40
        if ($output) {
41
            $output->writeln('<info>Preparing environment...</info>');
42
        }
43
        Environment::prepare();
44
45
        if ($output) {
46
            $output->writeln('<info>Preparing composer...</info>');
47
        }
48
        Composer::download();
49
        Composer::update();
50
51
        if ($output) {
52
            $output->writeln('<info>Updating database schema...</info>');
53
        }
54
        self::updateDatabaseSchema();
55
    }
56
}
57