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

DumpReferenceConfigurationFileCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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