Completed
Push — master ( ef5d35...9af83e )
by Thomas
12s queued 10s
created

DumpReferenceConfigurationFileCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 21
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 3 2
A configure() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the ekino Drupal Debug project.
7
 *
8
 * (c) ekino
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Ekino\Drupal\Debug\Composer\Command;
15
16
use Composer\Command\BaseCommand;
17
use Ekino\Drupal\Debug\Composer\Helper\ManageConfigurationHelper;
18
use Symfony\Component\Console\Input\InputInterface;
19
use Symfony\Component\Console\Output\OutputInterface;
20
21
class DumpReferenceConfigurationFileCommand extends BaseCommand
22
{
23
    /**
24
     * @var string
25
     */
26
    const NAME = 'drupal-debug:dump-reference-configuration-file';
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 1
    protected function configure(): void
32
    {
33 1
        $this->setName(self::NAME);
34 1
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    protected function execute(InputInterface $input, OutputInterface $output): ?int
40
    {
41
        return (new ManageConfigurationHelper($this->getComposer(), $this->getIO()))->dumpReferenceConfigurationFile() ? 0 : 1;
42
    }
43
}
44