summaryrefslogtreecommitdiffstats
path: root/core/Controller/OCSController.php
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-04-12 17:55:01 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-05-20 22:18:06 +0200
commitb70c6a128fe5d0053b7971881696eafce4cb7c26 (patch)
tree641ff76531803c207a92d86f47d46b6dd93ab6d3 /core/Controller/OCSController.php
parent2b0d82675f669f00ad90f2750b1832a60ec9f766 (diff)
downloadnextcloud-server-b70c6a128fe5d0053b7971881696eafce4cb7c26.tar.gz
nextcloud-server-b70c6a128fe5d0053b7971881696eafce4cb7c26.zip
Update core to PHP 7.4 standard
- Typed properties - Port to LoggerInterface Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'core/Controller/OCSController.php')
-rw-r--r--core/Controller/OCSController.php44
1 files changed, 9 insertions, 35 deletions
diff --git a/core/Controller/OCSController.php b/core/Controller/OCSController.php
index 63a25591ef0..b40776fcfb8 100644
--- a/core/Controller/OCSController.php
+++ b/core/Controller/OCSController.php
@@ -35,27 +35,12 @@ use OCP\IUserManager;
use OCP\IUserSession;
class OCSController extends \OCP\AppFramework\OCSController {
+ private CapabilitiesManager $capabilitiesManager;
+ private IUserSession $userSession;
+ private IUserManager $userManager;
+ private Manager $keyManager;
- /** @var CapabilitiesManager */
- private $capabilitiesManager;
- /** @var IUserSession */
- private $userSession;
- /** @var IUserManager */
- private $userManager;
- /** @var Manager */
- private $keyManager;
-
- /**
- * OCSController constructor.
- *
- * @param string $appName
- * @param IRequest $request
- * @param CapabilitiesManager $capabilitiesManager
- * @param IUserSession $userSession
- * @param IUserManager $userManager
- * @param Manager $keyManager
- */
- public function __construct($appName,
+ public function __construct(string $appName,
IRequest $request,
CapabilitiesManager $capabilitiesManager,
IUserSession $userSession,
@@ -70,10 +55,8 @@ class OCSController extends \OCP\AppFramework\OCSController {
/**
* @PublicPage
- *
- * @return DataResponse
*/
- public function getConfig() {
+ public function getConfig(): DataResponse {
$data = [
'version' => '1.7',
'website' => 'Nextcloud',
@@ -87,10 +70,8 @@ class OCSController extends \OCP\AppFramework\OCSController {
/**
* @PublicPage
- *
- * @return DataResponse
*/
- public function getCapabilities() {
+ public function getCapabilities(): DataResponse {
$result = [];
[$major, $minor, $micro] = \OCP\Util::getVersion();
$result['version'] = [
@@ -116,12 +97,8 @@ class OCSController extends \OCP\AppFramework\OCSController {
/**
* @PublicPage
* @BruteForceProtection(action=login)
- *
- * @param string $login
- * @param string $password
- * @return DataResponse
*/
- public function personCheck($login = '', $password = '') {
+ public function personCheck(string $login = '', string $password = ''): DataResponse {
if ($login !== '' && $password !== '') {
if ($this->userManager->checkPassword($login, $password)) {
return new DataResponse([
@@ -140,11 +117,8 @@ class OCSController extends \OCP\AppFramework\OCSController {
/**
* @PublicPage
- *
- * @param string $cloudId
- * @return DataResponse
*/
- public function getIdentityProof($cloudId) {
+ public function getIdentityProof(string $cloudId): DataResponse {
$userObject = $this->userManager->get($cloudId);
if ($userObject !== null) {