aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command/Security
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command/Security')
-rw-r--r--core/Command/Security/ImportCertificate.php5
-rw-r--r--core/Command/Security/ListCertificates.php3
-rw-r--r--core/Command/Security/RemoveCertificate.php3
-rw-r--r--core/Command/Security/ResetBruteforceAttempts.php3
4 files changed, 9 insertions, 5 deletions
diff --git a/core/Command/Security/ImportCertificate.php b/core/Command/Security/ImportCertificate.php
index 7d540bc946d..0d4ca70dabf 100644
--- a/core/Command/Security/ImportCertificate.php
+++ b/core/Command/Security/ImportCertificate.php
@@ -49,17 +49,18 @@ class ImportCertificate extends Base {
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$path = $input->getArgument('path');
if (!file_exists($path)) {
$output->writeln('<error>certificate not found</error>');
- return;
+ return 1;
}
$certData = file_get_contents($path);
$name = basename($path);
$this->certificateManager->addCertificate($certData, $name);
+ return 0;
}
}
diff --git a/core/Command/Security/ListCertificates.php b/core/Command/Security/ListCertificates.php
index 594fa1bc4d5..59cb92abe1d 100644
--- a/core/Command/Security/ListCertificates.php
+++ b/core/Command/Security/ListCertificates.php
@@ -50,7 +50,7 @@ class ListCertificates extends Base {
parent::configure();
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$outputType = $input->getOption('output');
if ($outputType === self::OUTPUT_FORMAT_JSON || $outputType === self::OUTPUT_FORMAT_JSON_PRETTY) {
$certificates = array_map(function (ICertificate $certificate) {
@@ -91,5 +91,6 @@ class ListCertificates extends Base {
$table->setRows($rows);
$table->render();
}
+ return 0;
}
}
diff --git a/core/Command/Security/RemoveCertificate.php b/core/Command/Security/RemoveCertificate.php
index 4aa97a61757..fd0b536f299 100644
--- a/core/Command/Security/RemoveCertificate.php
+++ b/core/Command/Security/RemoveCertificate.php
@@ -50,9 +50,10 @@ class RemoveCertificate extends Base {
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$name = $input->getArgument('name');
$this->certificateManager->removeCertificate($name);
+ return 0;
}
}
diff --git a/core/Command/Security/ResetBruteforceAttempts.php b/core/Command/Security/ResetBruteforceAttempts.php
index dcb827f8ddb..694b65c7acf 100644
--- a/core/Command/Security/ResetBruteforceAttempts.php
+++ b/core/Command/Security/ResetBruteforceAttempts.php
@@ -49,7 +49,7 @@ class ResetBruteforceAttempts extends Base {
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$ip = $input->getArgument('ipaddress');
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
@@ -58,5 +58,6 @@ class ResetBruteforceAttempts extends Base {
}
$this->throttler->resetDelayForIP($ip);
+ return 0;
}
}