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.

StatusCommand::execute()   A
last analyzed

Complexity

Conditions 4
Paths 6

Size

Total Lines 21
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 21
rs 9.0534
c 1
b 0
f 0
cc 4
eloc 16
nc 6
nop 2
1
<?php
2
3
namespace Dami\Cli\Command;
4
5
use Symfony\Component\Console\Input\InputArgument,
6
    Symfony\Component\Console\Input\InputOption,
7
    Symfony\Component\Console,
8
    Symfony\Component\Console\Input\InputInterface,
9
    Symfony\Component\Console\Output\OutputInterface;
10
11
use Dami\Migration\MigrationFiles;
12
13
class StatusCommand extends ContainerAwareCommand
14
{
15
    protected function configure()
16
    {
17
        parent::configure();
18
        $this
19
            ->setDescription('Migrations status.');
20
    }
21
22
    protected function execute(InputInterface $input, OutputInterface $output)
23
    {
24
        parent::execute($input, $output);
25
26
        $migrationFiles = $this->getContainer()->get('dami.migration_files');
27
        $migrationFiles->statusIntention();
28
        $rows = array();
29
        foreach ($migrationFiles->get() as $migrationFile) {
30
            $status = $migrationFile->isMigrated() ? 'Migrated' : 'Not migrated';
31
            $rows[] = array($status, $migrationFile->getVersion(), $migrationFile->getName());
32
        }
33
        if (count($rows) > 0) {
34
            $table = $this->getHelperSet()->get('table');
35
            $table
36
                ->setHeaders(array('Status', 'Version', 'Name'))
37
                ->setRows($rows)
38
                ->render($output);
39
        } else {
40
            $output->writeln(sprintf('<comment>There are no migrations.</comment>'));
41
        }
42
    }
43
}
44