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 ( c87318...99f3de )
by Bruno
30:58
created

YumlCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 1
cbo 5
dl 0
loc 41
ccs 29
cts 29
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 12 1
B execute() 0 25 1
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 1
    protected function configure()
19
    {
20 1
        $this->setName('yuml:mappings')
21 1
            ->setDescription('Generate an image from yuml.me of doctrine metadata')
22 1
            ->addOption(
23 1
                'filename',
24 1
                'f',
25 1
                InputOption::VALUE_REQUIRED,
26 1
                'Output filename',
27 1
                'yuml-mapping.png'
28
            );
29 1
    }
30
31 1
    protected function execute(InputInterface $input, OutputInterface $output)
32
    {
33
        /** @var YumlClient $yumlClient */
34 1
        $yumlClient = $this->getContainer()->get('onurb_yuml.client');
35 1
        $filename = $input->getOption('filename');
36
37 1
        $showDetailParam = $this->getContainer()->getParameter('onurb_yuml.show_fields_description');
38 1
        $colorsParam = $this->getContainer()->getParameter('onurb_yuml.colors');
39 1
        $notesParam = $this->getContainer()->getParameter('onurb_yuml.notes');
40 1
        $styleParam = $this->getContainer()->getParameter('onurb_yuml.style');
41 1
        $extensionParam = $this->getContainer()->getParameter('onurb_yuml.extension');
42 1
        $direction = $this->getContainer()->getParameter('onurb_yuml.direction');
43 1
        $scale = $this->getContainer()->getParameter('onurb_yuml.scale');
44
45 1
        $graphUrl = $yumlClient->getGraphUrl(
46 1
            $yumlClient->makeDslText($showDetailParam, $colorsParam, $notesParam),
47 1
            $styleParam,
48 1
            $extensionParam,
49 1
            $direction,
50 1
            $scale
51
        );
52 1
        $yumlClient->downloadImage($graphUrl, $filename);
53
54 1
        $output->writeln(sprintf('Downloaded <info>%s</info> to <info>%s</info>', $graphUrl, $filename));
55 1
    }
56
}
57