ConfigurationCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Glamorous\Boiler;
4
5
use Glamorous\Boiler\Helpers\Configuration;
6
use Symfony\Component\Console\Command\Command;
7
8
abstract class ConfigurationCommand extends Command
9
{
10
    /**
11
     * Singleton instance of Configuration
12
     *
13
     * @var Configuration
14
     */
15
    protected $configuration;
16
17
    /**
18
     * Constructor
19
     *
20
     * @param string|null $name The name of the command; passing null means it must be set in configure()
21
     */
22
    public function __construct(string $name = null)
23
    {
24
        $this->configuration = $this->getConfiguration();
25
26
        parent::__construct($name);
27
    }
28
29
    final private function getConfiguration(): Configuration
30
    {
31
        return Configuration::getInstance();
32
    }
33
}
34