forked from nextcloud/calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Georg Ehrke <[email protected]>
- Loading branch information
1 parent
352b36b
commit 1ec99c0
Showing
5 changed files
with
37 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* Calendar App | ||
* | ||
* @author Georg Ehrke | ||
* @copyright 2016 Georg Ehrke <[email protected]> | ||
* @copyright 2018 Georg Ehrke <[email protected]> | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | ||
|
@@ -40,7 +40,7 @@ class ContactController extends Controller { | |
* @param IRequest $request an instance of the request | ||
* @param IManager $contacts | ||
*/ | ||
public function __construct($appName, IRequest $request, IManager $contacts) { | ||
public function __construct(string $appName, IRequest $request, IManager $contacts) { | ||
parent::__construct($appName, $request); | ||
$this->contacts = $contacts; | ||
} | ||
|
@@ -52,7 +52,7 @@ public function __construct($appName, IRequest $request, IManager $contacts) { | |
* | ||
* @NoAdminRequired | ||
*/ | ||
public function searchLocation($location) { | ||
public function searchLocation(string $location):JSONResponse { | ||
$result = $this->contacts->search($location, ['FN', 'ADR']); | ||
|
||
$contacts = []; | ||
|
@@ -62,7 +62,7 @@ public function searchLocation($location) { | |
} | ||
|
||
$name = $this->getNameFromContact($r); | ||
if (is_string($r['ADR'])) { | ||
if (\is_string($r['ADR'])) { | ||
$r['ADR'] = [$r['ADR']]; | ||
} | ||
|
||
|
@@ -85,7 +85,7 @@ public function searchLocation($location) { | |
* | ||
* @NoAdminRequired | ||
*/ | ||
public function searchAttendee($search) { | ||
public function searchAttendee(string $search):JSONResponse { | ||
$result = $this->contacts->search($search, ['FN', 'EMAIL']); | ||
|
||
$contacts = []; | ||
|
@@ -95,7 +95,7 @@ public function searchAttendee($search) { | |
} | ||
|
||
$name = $this->getNameFromContact($r); | ||
if (is_string($r['EMAIL'])) { | ||
if (\is_string($r['EMAIL'])) { | ||
$r['EMAIL'] = [$r['EMAIL']]; | ||
} | ||
|
||
|
@@ -115,7 +115,7 @@ public function searchAttendee($search) { | |
* @param array $r | ||
* @return string | ||
*/ | ||
private function getNameFromContact(array $r) { | ||
private function getNameFromContact(array $r):string { | ||
$name = ''; | ||
if (isset($r['FN'])) { | ||
$name = $r['FN']; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.