aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command/User
diff options
context:
space:
mode:
authorLucas Azevedo <lhs_azevedo@hotmail.com>2023-08-25 10:41:46 -0300
committerGitHub <noreply@github.com>2023-08-25 10:41:46 -0300
commitc93b1634d347b9fe343be4785a6d7b7a3757e7ec (patch)
treea9dddd34ebbf504eb6d9016daaf0c4520c9bcae0 /core/Command/User
parent771a7b92cccb77a1b907a8cc0d022fb7b5103f8e (diff)
downloadnextcloud-server-c93b1634d347b9fe343be4785a6d7b7a3757e7ec.tar.gz
nextcloud-server-c93b1634d347b9fe343be4785a6d7b7a3757e7ec.zip
Fixes from static analysis
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com> Signed-off-by: Lucas Azevedo <lhs_azevedo@hotmail.com>
Diffstat (limited to 'core/Command/User')
-rw-r--r--core/Command/User/AuthTokens/Delete.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/Command/User/AuthTokens/Delete.php b/core/Command/User/AuthTokens/Delete.php
index 830050c1bb9..8cd6f2e6205 100644
--- a/core/Command/User/AuthTokens/Delete.php
+++ b/core/Command/User/AuthTokens/Delete.php
@@ -63,7 +63,7 @@ class Delete extends Base {
protected function execute(InputInterface $input, OutputInterface $output): int {
$uid = $input->getArgument('uid');
- $id = $input->getArgument('id');
+ $id = (int) $input->getArgument('id');
$before = $input->getOption('last-used-before');
if ($before) {
@@ -80,13 +80,13 @@ class Delete extends Base {
return $this->deleteById($uid, $id);
}
- protected function deleteById(string $uid, string $id) {
+ protected function deleteById(string $uid, int $id): int {
$this->tokenProvider->invalidateTokenById($uid, $id);
return Command::SUCCESS;
}
- protected function deleteLastUsedBefore(string $uid, string $before) {
+ protected function deleteLastUsedBefore(string $uid, string $before): int {
$date = $this->parseDateOption($before);
if (!$date) {
throw new RuntimeException('Invalid date format. Acceptable formats are: ISO8601 (w/o fractions), "YYYY-MM-DD" and Unix time in seconds.');