summaryrefslogtreecommitdiffstats
path: root/lib/Service/SocialApiService.php
diff options
context:
space:
mode:
authorleith abdulla <online-nextcloud@eleith.com>2020-11-01 19:31:58 -0800
committerleith abdulla <online-nextcloud@eleith.com>2020-11-01 19:54:19 -0800
commitda321c14516862c1216f57060d1d609704f61c9d (patch)
tree7616a67f2079316d8b04283ffdbc69fded8753d9 /lib/Service/SocialApiService.php
parent296ebf7c7cbe44d297625e29c681b3a8ffb3dc3c (diff)
linting, unit tests, comment fixes
Signed-off-by: leith abdulla <online-nextcloud@eleith.com>
Diffstat (limited to 'lib/Service/SocialApiService.php')
-rw-r--r--lib/Service/SocialApiService.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Service/SocialApiService.php b/lib/Service/SocialApiService.php
index af07c998..446a9ef6 100644
--- a/lib/Service/SocialApiService.php
+++ b/lib/Service/SocialApiService.php
@@ -167,10 +167,10 @@ class SocialApiService {
*
* @returns {JSONResponse} an empty JSONResponse with respective http status code
*/
- public function updateContact(string $addressbookId, string $contactId, string $network) : JSONResponse {
+ public function updateContact(string $addressbookId, string $contactId, ?string $network) : JSONResponse {
$socialdata = null;
$imageType = null;
- $urls = array();
+ $urls = [];
$allConnectors = $this->socialProvider->getSocialConnectors();
try {
@@ -191,7 +191,7 @@ class SocialApiService {
$allConnectors = [$this->socialProvider->getSocialConnector($network)];
}
- $connectors = array_filter($allConnectors, function($connector) use($contact) {
+ $connectors = array_filter($allConnectors, function ($connector) use ($contact) {
return $connector->supportsContact($contact);
});
@@ -199,7 +199,7 @@ class SocialApiService {
return new JSONResponse([], Http::STATUS_PRECONDITION_FAILED);
}
- foreach($connectors as $connector) {
+ foreach ($connectors as $connector) {
$urls = array_merge($connector->getImageUrls($contact), $urls);
}
@@ -207,7 +207,7 @@ class SocialApiService {
return new JSONResponse([], Http::STATUS_BAD_REQUEST);
}
- foreach($urls as $url) {
+ foreach ($urls as $url) {
try {
$httpResult = $this->clientService->NewClient()->get($url);
$socialdata = $httpResult->getBody();
@@ -215,7 +215,7 @@ class SocialApiService {
if (isset($socialdata) && isset($imageType)) {
break;
}
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}