From 9122ed1bdee76f0ef37fb5996d25656083b7a4a6 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 23 May 2022 14:41:33 +0200 Subject: [locationinfo] Add types --- .../inc/coursebackend/coursebackend_exchange.inc.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'modules-available/locationinfo/inc/coursebackend/coursebackend_exchange.inc.php') diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_exchange.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_exchange.inc.php index 44847ce2..a0eca0ec 100755 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_exchange.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_exchange.inc.php @@ -38,7 +38,7 @@ class CourseBackend_Exchange extends CourseBackend /** * @return string return display name of backend */ - public function getDisplayName() + public function getDisplayName(): string { return "Microsoft Exchange"; } @@ -46,7 +46,7 @@ class CourseBackend_Exchange extends CourseBackend /** * @returns \BackendProperty[] list of properties that need to be set */ - public function getCredentialDefinitions() + public function getCredentialDefinitions(): array { $options = [ Client::VERSION_2007, @@ -72,7 +72,7 @@ class CourseBackend_Exchange extends CourseBackend /** * @return boolean true if the connection works, false otherwise */ - public function checkConnection() + public function checkConnection(): bool { $client = $this->getClient(); $request = new ResolveNamesType(); @@ -104,7 +104,7 @@ class CourseBackend_Exchange extends CourseBackend * @param array $data assoc array with data required by backend * @returns bool if the credentials were in the correct format */ - public function setCredentialsInternal($data) + public function setCredentialsInternal(array $data): bool { foreach (['username', 'password'] as $field) { if (empty($data[$field])) { @@ -133,7 +133,7 @@ class CourseBackend_Exchange extends CourseBackend /** * @return int desired caching time of results, in seconds. 0 = no caching */ - public function getCacheTime() + public function getCacheTime(): int { return 15 * 60; } @@ -142,7 +142,7 @@ class CourseBackend_Exchange extends CourseBackend * @return int age after which timetables are no longer refreshed. should be * greater than CacheTime. */ - public function getRefreshTime() + public function getRefreshTime(): int { return 30 * 60; } @@ -150,12 +150,12 @@ class CourseBackend_Exchange extends CourseBackend /** * Internal version of fetch, to be overridden by subclasses. * - * @param $roomIds array with local ID as key and serverId as value + * @param $requestedRoomIds array with local ID as key and serverId as value * @return array a recursive array that uses the roomID as key * and has the schedule array as value. A schedule array contains an array in this format: * ["start"=>'JJJJ-MM-DD HH:MM:SS',"end"=>'JJJJ-MM-DD HH:MM:SS',"title"=>string] */ - protected function fetchSchedulesInternal($requestedRoomIds) + protected function fetchSchedulesInternal(array $requestedRoomIds): array { $startDate = new DateTime('last Monday 0:00'); $endDate = new DateTime('+14 days 0:00'); -- cgit v1.2.3-55-g7522