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.
Completed
Push — master ( 4edf76...a91441 )
by Bruno
21:43
created

YumlCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 15
ccs 0
cts 11
cp 0
rs 9.4285
cc 1
eloc 9
nc 1
nop 2
crap 2
1
<?php
2
namespace Onurb\Bundle\YumlBundle\Command;
3
4
use Onurb\Bundle\YumlBundle\Yuml\YumlClient;
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputOption;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
/**
11
 * Generate and save Yuml images for metadata graphs.
12
 *
13
 * @license MIT
14
 * @author Glynn Forrest <[email protected]>
15
 **/
16
class YumlCommand extends ContainerAwareCommand
17
{
18
    protected function configure()
19
    {
20
        $this->setName('yuml:mappings')
21
            ->setDescription('Generate an image from yuml.me of doctrine metadata')
22
            ->addOption(
23
                'filename',
24
                'f',
25
                InputOption::VALUE_REQUIRED,
26
                'Output filename',
27
                'yuml-mapping.png'
28
            );
29
    }
30
31
    protected function execute(InputInterface $input, OutputInterface $output)
32
    {
33
        /** @var YumlClient $yumlClient */
34
        $yumlClient = $this->getContainer()->get('onurb_yuml.client');
35
        $filename = $input->getOption('filename');
36
37
        $showDetailParam = $this->getContainer()->getParameter('onurb_yuml.show_fields_description');
38
        $colorsParam = $this->getContainer()->getParameter('onurb_yuml.colors');
39
        $notesParam = $this->getContainer()->getParameter('onurb_yuml.notes');
40
41
        $graphUrl = $yumlClient->getGraphUrl($yumlClient->makeDslText($showDetailParam, $colorsParam, $notesParam));
42
        $yumlClient->downloadImage($graphUrl, $filename);
43
44
        $output->writeln(sprintf('Downloaded <info>%s</info> to <info>%s</info>', $graphUrl, $filename));
45
    }
46
}
47