<?php
+
+declare(strict_types=1);
+
/**
* @copyright Copyright (c) 2016 Robin Appelman <robin@icewind.nl>
*
if ($input->getOption('user')) {
return (string)$input->getOption('user');
} elseif (isset($_ENV['NOTIFY_USER'])) {
- return (string)$_ENV['NOTIFY_USER'];
+ return $_ENV['NOTIFY_USER'];
} elseif (isset($_SERVER['NOTIFY_USER'])) {
- return (string)$_SERVER['NOTIFY_USER'];
+ return $_SERVER['NOTIFY_USER'];
} else {
return null;
}
if ($input->getOption('password')) {
return (string)$input->getOption('password');
} elseif (isset($_ENV['NOTIFY_PASSWORD'])) {
- return (string)$_ENV['NOTIFY_PASSWORD'];
+ return $_ENV['NOTIFY_PASSWORD'];
} elseif (isset($_SERVER['NOTIFY_PASSWORD'])) {
- return (string)$_SERVER['NOTIFY_PASSWORD'];
+ return $_SERVER['NOTIFY_PASSWORD'];
} else {
return null;
}
</RedundantCondition>
</file>
<file src="lib/private/Authentication/Token/PublicKeyToken.php">
- <UndefinedMethod occurrences="16">
+ <UndefinedMagicMethod occurrences="16">
<code>parent::getExpires()</code>
<code>parent::getLastCheck()</code>
<code>parent::getLoginName()</code>
<code>parent::setScope(json_encode($scope))</code>
<code>parent::setToken($token)</code>
<code>parent::setType(IToken::WIPE_TOKEN)</code>
- </UndefinedMethod>
+ </UndefinedMagicMethod>
</file>
<file src="lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php">
<InvalidReturnStatement occurrences="1"/>
public function render() {
$meta = [
'status' => $this->getOCSStatus() === 100 ? 'ok' : 'failure',
- 'statuscode' => $this->getOCSStatus(),
- 'message' => $this->getOCSStatus() === 100 ? 'OK' : $this->statusMessage,
+ 'statuscode' => (string)$this->getOCSStatus(),
+ 'message' => $this->getOCSStatus() === 100 ? 'OK' : $this->statusMessage ?? '',
+ 'totalitems' => (string)($this->itemsCount ?? ''),
+ 'itemsperpage' => (string)($this->itemsPerPage ?? ''),
];
- $meta['totalitems'] = $this->itemsCount !== null ? (string)$this->itemsCount : '';
- $meta['itemsperpage'] = $this->itemsPerPage !== null ? (string)$this->itemsPerPage: '';
-
return $this->renderResult($meta);
}
}
public static function requestedFormat(): string {
$formats = ['json', 'xml'];
- $format = (isset($_GET['format']) && in_array($_GET['format'], $formats)) ? $_GET['format'] : 'xml';
+ $format = (isset($_GET['format']) && is_string($_GET['format']) && in_array($_GET['format'], $formats)) ? $_GET['format'] : 'xml';
return $format;
}