Passed
Pull Request — develop (#18)
by Kevin
03:58 queued 41s
created

ConfigurationBuild::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
3
namespace Magium\Configuration\Console\Command;
4
5
use Magium\Configuration\Config\Config;
6
use Magium\Configuration\MagiumConfigurationFactory;
7
use Symfony\Component\Console\Command\Command;
8
use Symfony\Component\Console\Input\InputArgument;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
class ConfigurationBuild extends Command
13
{
14
15
    const COMMAND = 'magium:configuration:build';
16
17
    protected function configure()
18
    {
19
        $this
20
            ->setName(self::COMMAND)
21
            ->setDescription('Build configuration')
22
            ->setHelp(
23
                'This command will build the configuration object based off of configuration files and '
24
                . 'persistent storage data.  By default, it will rebuild all contexts, but you can specify an '
25
                . 'individual context if you so like.')
26
        ;
27
28
        $this->addArgument('context', InputArgument::OPTIONAL, 'Configuration Context (ignore to build all contexts)');
29
    }
30
31
    protected function execute(InputInterface $input, OutputInterface $output)
32
    {
33
        $factory = new MagiumConfigurationFactory();
34
        $builder = $factory->getBuilder();
35
        $contexts = [];
36
        $contextFile = $factory->getContextFile();
37
        if ($context = $input->getArgument('context')) {
38
            $contexts[] = $context;
39
        } else {
40
            $factory->
41
        }
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected '}', expecting T_STRING or T_VARIABLE or '{' or '$'
Loading history...
42
    }
43
44
}
45