NoneKeyGeneratorCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
A execute() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2019 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
final class NoneKeyGeneratorCommand extends GeneratorCommand
21
{
22
    protected function configure(): void
23
    {
24
        parent::configure();
25
        $this
26
            ->setName('key:generate:none')
27
            ->setDescription('Generate a none key (JWK format). This key type is only supposed to be used with the "none" algorithm.')
28
        ;
29
    }
30
31
    protected function execute(InputInterface $input, OutputInterface $output): ?int
32
    {
33
        $args = $this->getOptions($input);
34
35
        $jwk = JWKFactory::createNoneKey($args);
36
        $this->prepareJsonOutput($input, $output, $jwk);
37
38
        return 0;
39
    }
40
}
41