Skip to content

Commit 40769c7

Browse files
committed
chore: correct php docs
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
1 parent f7a1b75 commit 40769c7

12 files changed

Lines changed: 98 additions & 94 deletions

lib/Controller/SocialApiController.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public function __construct(
3434
/**
3535
* update appconfig (admin setting)
3636
*
37-
* @param {String} key the identifier to change
38-
* @param {String} allow the value to set
37+
* @param string $key the identifier to change
38+
* @param string $allow the value to set
3939
*
40-
* @returns {JSONResponse} an empty JSONResponse with respective http status code
40+
* @return JSONResponse an empty JSONResponse with respective http status code
4141
*/
4242
public function setAppConfig($key, $allow) {
4343
$permittedKeys = ['allowSocialSync'];
@@ -53,10 +53,10 @@ public function setAppConfig($key, $allow) {
5353
*
5454
* update appconfig (user setting)
5555
*
56-
* @param {String} key the identifier to change
57-
* @param {String} allow the value to set
56+
* @param string $key the identifier to change
57+
* @param string $allow the value to set
5858
*
59-
* @returns {JSONResponse} an empty JSONResponse with respective http status code
59+
* @return JSONResponse an empty JSONResponse with respective http status code
6060
*/
6161
public function setUserConfig($key, $allow) {
6262
$user = $this->userSession->getUser();
@@ -74,9 +74,9 @@ public function setUserConfig($key, $allow) {
7474
*
7575
* retrieve appconfig (user setting)
7676
*
77-
* @param {String} key the identifier to retrieve
77+
* @param string $key the identifier to retrieve
7878
*
79-
* @returns {string} the desired value or null if not existing
79+
* @return string|null the desired value or null if not existing
8080
*/
8181
public function getUserConfig($key) {
8282
$user = $this->userSession->getUser();
@@ -93,7 +93,7 @@ public function getUserConfig($key) {
9393
*
9494
* returns an array of supported social networks
9595
*
96-
* @returns {array} array of the supported social networks
96+
* @return array array of the supported social networks
9797
*/
9898
public function getSupportedNetworks() : array {
9999
return $this->socialApiService->getSupportedNetworks();
@@ -105,11 +105,11 @@ public function getSupportedNetworks() : array {
105105
*
106106
* Retrieves social profile data for a contact and updates the entry
107107
*
108-
* @param {String} addressbookId the addressbook identifier
109-
* @param {String} contactId the contact identifier
110-
* @param {String} network the social network to use (if unkown: take first match)
108+
* @param string $addressbookId the addressbook identifier
109+
* @param string $contactId the contact identifier
110+
* @param string $network the social network to use (if unknown: take first match)
111111
*
112-
* @returns {JSONResponse} an empty JSONResponse with respective http status code
112+
* @return JSONResponse an empty JSONResponse with respective http status code
113113
*/
114114
public function updateContact(string $addressbookId, string $contactId, string $network) : JSONResponse {
115115
return $this->socialApiService->updateContact($addressbookId, $contactId, $network);

lib/Service/Social/CompositeSocialProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(InstagramProvider $instagramProvider,
3838
/**
3939
* returns an array of supported social providers
4040
*
41-
* @returns String[] array of the supported social networks
41+
* @return string[] array of the supported social networks
4242
*/
4343
public function getSupportedNetworks() : array {
4444
return array_keys($this->providers);

lib/Service/Social/DiasporaProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(IClientService $httpClient) {
2828
/**
2929
* Returns if this provider supports this contact
3030
*
31-
* @param {array} contact info
31+
* @param array $contact contact info
3232
*
3333
* @return bool
3434
*/
@@ -44,7 +44,7 @@ public function supportsContact(array $contact):bool {
4444
/**
4545
* Returns all possible profile-picture urls
4646
*
47-
* @param {array} contact information
47+
* @param array $contact contact information
4848
*
4949
* @return array
5050
*/
@@ -66,7 +66,7 @@ public function getImageUrls(array $contact):array {
6666
/**
6767
* Returns the profile-picture url
6868
*
69-
* @param {string} profileId the profile-id
69+
* @param string $profileUrl the profile-id
7070
*
7171
* @return string|null
7272
*/
@@ -96,7 +96,7 @@ protected function getImageUrl(string $profileUrl):?string {
9696
/**
9797
* Returns all possible profile ids for contact
9898
*
99-
* @param {array} contact information
99+
* @param array $contact contact information
100100
*
101101
* @return array
102102
*/
@@ -120,9 +120,9 @@ protected function getProfileIds($contact):array {
120120
/**
121121
* Returns the profile-id
122122
*
123-
* @param {string} the value from the contact's x-socialprofile
123+
* @param string $candidate the value from the contact's x-socialprofile
124124
*
125-
* @return string
125+
* @return string|null
126126
*/
127127
protected function cleanupId(string $candidate):?string {
128128
try {

lib/Service/Social/FacebookProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(IClientService $httpClient) {
2424
/**
2525
* Returns if this provider supports this contact
2626
*
27-
* @param {array} contact info
27+
* @param array $contact contact info
2828
*
2929
* @return bool
3030
*/
@@ -40,7 +40,7 @@ public function supportsContact(array $contact):bool {
4040
/**
4141
* Returns the profile-picture url
4242
*
43-
* @param {array} contact information
43+
* @param array $contact contact information
4444
*
4545
* @return array
4646
*/
@@ -59,7 +59,7 @@ public function getImageUrls(array $contact):array {
5959
/**
6060
* Returns the profile-id
6161
*
62-
* @param {string} the value from the contact's x-socialprofile
62+
* @param string $candidate the value from the contact's x-socialprofile
6363
*
6464
* @return string
6565
*/
@@ -74,7 +74,7 @@ protected function cleanupId(string $candidate):string {
7474
/**
7575
* Returns all possible profile ids for contact
7676
*
77-
* @param {array} contact information
77+
* @param array $contact contact information
7878
*
7979
* @return array of string profile ids
8080
*/
@@ -94,7 +94,7 @@ protected function getProfiles(array $contact):array {
9494
/**
9595
* Returns all possible profile ids for contact
9696
*
97-
* @param {array} contact information
97+
* @param array $contact contact information
9898
*
9999
* @return array of string profile ids
100100
*/
@@ -113,7 +113,7 @@ protected function getProfileIds(array $contact):array {
113113
* Fallback: return profile name
114114
* (will give oauth error from facebook except if profile is public)
115115
*
116-
* @param {string} profileName the user's profile name
116+
* @param string $profileName the user's profile name
117117
*
118118
* @return string
119119
*/

lib/Service/Social/GravatarProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __construct() {
1717
/**
1818
* Returns if this provider supports this contact
1919
*
20-
* @param {array} contact info
20+
* @param array $contact contact info
2121
*
2222
* @return bool
2323
*/
@@ -33,7 +33,7 @@ public function supportsContact(array $contact):bool {
3333
/**
3434
* Returns the profile-picture url
3535
*
36-
* @param {array} contact information
36+
* @param array $contact contact information
3737
*
3838
* @return array
3939
*/

lib/Service/Social/ISocialProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface ISocialProvider {
1111
/**
1212
* Returns true if provider supports the contact
1313
*
14-
* @param {array} contact details
14+
* @param array $contact contact details
1515
*
1616
* @return boolean
1717
*/
@@ -20,7 +20,7 @@ public function supportsContact(array $contact):bool ;
2020
/**
2121
* Returns all possible profile-picture urls
2222
*
23-
* @param {array} contact information
23+
* @param array $contact contact information
2424
*
2525
* @return array
2626
*/

lib/Service/Social/InstagramProvider.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(IClientService $httpClient,
3131
/**
3232
* Returns if this provider supports this contact
3333
*
34-
* @param {array} contact info
34+
* @param array $contact contact info
3535
*
3636
* @return bool
3737
*/
@@ -47,7 +47,7 @@ public function supportsContact(array $contact):bool {
4747
/**
4848
* Returns the profile-picture url
4949
*
50-
* @param {array} contact information
50+
* @param array $contact contact information
5151
*
5252
* @return array
5353
*/
@@ -67,7 +67,7 @@ public function getImageUrls(array $contact):array {
6767
/**
6868
* Returns the profile-id
6969
*
70-
* @param {string} the value from the contact's x-socialprofile
70+
* @param string $candidate the value from the contact's x-socialprofile
7171
*
7272
* @return string
7373
*/
@@ -79,7 +79,7 @@ protected function cleanupId(string $candidate):string {
7979
/**
8080
* Returns all possible profile urls for contact
8181
*
82-
* @param {array} contact information
82+
* @param array $contact contact information
8383
*
8484
* @return array of string profile urls
8585
*/
@@ -99,7 +99,7 @@ protected function getProfiles($contact):array {
9999
/**
100100
* Returns all possible profile ids for contact
101101
*
102-
* @param {array} contact information
102+
* @param array $contact contact information
103103
*
104104
* @return array of string profile ids
105105
*/
@@ -115,10 +115,10 @@ protected function getProfileIds($contact):array {
115115
/**
116116
* extracts desired value from a json
117117
*
118-
* @param {string} url the target from where to fetch the json
119-
* @param {String} the desired key to filter for (nesting possible with '->')
118+
* @param string $url the target from where to fetch the json
119+
* @param string $desired the desired key to filter for (nesting possible with '->')
120120
*
121-
* @returns {String} the extracted value or null if not present
121+
* @return string|null the extracted value or null if not present
122122
*/
123123
protected function getFromJson(string $url, string $desired) : ?string {
124124
try {

lib/Service/Social/MastodonProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(IClientService $httpClient) {
2424
/**
2525
* Returns if this provider supports this contact
2626
*
27-
* @param {array} contact info
27+
* @param array $contact contact info
2828
*
2929
* @return bool
3030
*/
@@ -40,7 +40,7 @@ public function supportsContact(array $contact):bool {
4040
/**
4141
* Returns all possible profile-picture urls
4242
*
43-
* @param {array} contact information
43+
* @param array $contact contact information
4444
*
4545
* @return array
4646
*/
@@ -60,7 +60,7 @@ public function getImageUrls(array $contact):array {
6060
/**
6161
* Returns the profile-picture url
6262
*
63-
* @param {array} contact information
63+
* @param string $profileUrl profile URL
6464
*
6565
* @return string|null
6666
*/
@@ -77,7 +77,7 @@ public function getImageUrl(string $profileUrl):?string {
7777
/**
7878
* Returns all possible profile URI for contact by searching the mastodon instance
7979
*
80-
* @param {array} contact information
80+
* @param array $contact contact information
8181
*
8282
* @return array of possible profileIds
8383
*/
@@ -116,9 +116,9 @@ protected function getProfileIds($contact):array {
116116
/**
117117
* Returns the profile-id
118118
*
119-
* @param {string} the value from the contact's x-socialprofile
119+
* @param string $candidate the value from the contact's x-socialprofile
120120
*
121-
* @return array username and server instance
121+
* @return array|null username and server instance
122122
*/
123123
protected function cleanupId(string $candidate):?array {
124124
$candidate = preg_replace('/^' . preg_quote('x-apple:', '/') . '/', '', $candidate);

lib/Service/Social/TelegramProvider.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(IClientService $httpClient,
3131
/**
3232
* Returns if this provider supports this contact
3333
*
34-
* @param {array} contact info
34+
* @param array $contact contact info
3535
*
3636
* @return bool
3737
*/
@@ -47,7 +47,7 @@ public function supportsContact(array $contact):bool {
4747
/**
4848
* Returns the profile-picture url
4949
*
50-
* @param {array} contact information
50+
* @param array $contact contact information
5151
*
5252
* @return array
5353
*/
@@ -67,7 +67,7 @@ public function getImageUrls(array $contact):array {
6767
/**
6868
* Returns the profile-id
6969
*
70-
* @param {string} the value from the contact's x-socialprofile
70+
* @param string $candidate the value from the contact's x-socialprofile
7171
*
7272
* @return string
7373
*/
@@ -82,7 +82,7 @@ protected function cleanupId(string $candidate):string {
8282
/**
8383
* Returns all possible profile ids for contact
8484
*
85-
* @param {array} contact information
85+
* @param array $contact contact information
8686
*
8787
* @return array of string profile ids
8888
*/
@@ -102,10 +102,10 @@ protected function getProfileIds($contact):array {
102102
/**
103103
* extracts desired value from an html page
104104
*
105-
* @param {string} url the target from where to fetch the content
106-
* @param {String} the desired catchword to filter for
105+
* @param string $url the target from where to fetch the content
106+
* @param string $desired the desired catchword to filter for
107107
*
108-
* @returns {String} the extracted value (first match) or null if not present
108+
* @return string|null the extracted value (first match) or null if not present
109109
*/
110110
protected function getFromHtml(string $url, string $desired) : ?string {
111111
try {

0 commit comments

Comments
 (0)