@@ -31,37 +31,37 @@ |
||
31 | 31 | |
32 | 32 | class ImportCertificate extends Base { |
33 | 33 | |
34 | - /** @var ICertificateManager */ |
|
35 | - protected $certificateManager; |
|
34 | + /** @var ICertificateManager */ |
|
35 | + protected $certificateManager; |
|
36 | 36 | |
37 | - public function __construct(ICertificateManager $certificateManager) { |
|
38 | - $this->certificateManager = $certificateManager; |
|
39 | - parent::__construct(); |
|
40 | - } |
|
37 | + public function __construct(ICertificateManager $certificateManager) { |
|
38 | + $this->certificateManager = $certificateManager; |
|
39 | + parent::__construct(); |
|
40 | + } |
|
41 | 41 | |
42 | - protected function configure() { |
|
43 | - $this |
|
44 | - ->setName('security:certificates:import') |
|
45 | - ->setDescription('import trusted certificate in PEM format') |
|
46 | - ->addArgument( |
|
47 | - 'path', |
|
48 | - InputArgument::REQUIRED, |
|
49 | - 'path to the PEM certificate to import' |
|
50 | - ); |
|
51 | - } |
|
42 | + protected function configure() { |
|
43 | + $this |
|
44 | + ->setName('security:certificates:import') |
|
45 | + ->setDescription('import trusted certificate in PEM format') |
|
46 | + ->addArgument( |
|
47 | + 'path', |
|
48 | + InputArgument::REQUIRED, |
|
49 | + 'path to the PEM certificate to import' |
|
50 | + ); |
|
51 | + } |
|
52 | 52 | |
53 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
54 | - $path = $input->getArgument('path'); |
|
53 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
54 | + $path = $input->getArgument('path'); |
|
55 | 55 | |
56 | - if (!file_exists($path)) { |
|
57 | - $output->writeln('<error>Certificate not found, please provide a path accessible by the web server user</error>'); |
|
58 | - return 1; |
|
59 | - } |
|
56 | + if (!file_exists($path)) { |
|
57 | + $output->writeln('<error>Certificate not found, please provide a path accessible by the web server user</error>'); |
|
58 | + return 1; |
|
59 | + } |
|
60 | 60 | |
61 | - $certData = file_get_contents($path); |
|
62 | - $name = basename($path); |
|
61 | + $certData = file_get_contents($path); |
|
62 | + $name = basename($path); |
|
63 | 63 | |
64 | - $this->certificateManager->addCertificate($certData, $name); |
|
65 | - return 0; |
|
66 | - } |
|
64 | + $this->certificateManager->addCertificate($certData, $name); |
|
65 | + return 0; |
|
66 | + } |
|
67 | 67 | } |