Failed Conditions
Push — master ( 6aefc6...e9b4ba )
by Florent
02:15
created

NoneKeyGeneratorCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2017 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace Jose\Component\Console;
15
16
use Jose\Component\KeyManagement\JWKFactory;
17
use Symfony\Component\Console\Input\InputInterface;
18
use Symfony\Component\Console\Output\OutputInterface;
19
20
/**
21
 * Class NoneKeyGeneratorCommand.
22
 */
23
final class NoneKeyGeneratorCommand extends GeneratorCommand
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    protected function configure()
29
    {
30
        parent::configure();
31
        $this
32
            ->setName('key:generate:none')
33
            ->setDescription('Generate a none key (JWK format). This key type is only supposed to be used with the "none" algorithm.');
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    protected function execute(InputInterface $input, OutputInterface $output)
40
    {
41
        $args = $this->getOptions($input);
42
43
        $jwk = JWKFactory::createNoneKey($args);
44
        $this->prepareJsonOutput($input, $output, $jwk);
45
    }
46
}
47