ConfigurationCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getConfiguration() 0 3 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