Passed
Branch main (d68b9c)
by smiley
09:54
created

Flickr   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 19
c 2
b 0
f 0
dl 0
loc 39
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A request() 0 21 1
1
<?php
2
/**
3
 * Class Flickr
4
 *
5
 * @link https://www.flickr.com/services/api/auth.oauth.html
6
 * @link https://www.flickr.com/services/api/
7
 *
8
 * @filesource   Flickr.php
9
 * @created      20.10.2017
10
 * @package      chillerlan\OAuth\Providers\Flickr
11
 * @author       Smiley <[email protected]>
12
 * @copyright    2017 Smiley
13
 * @license      MIT
14
 */
15
16
namespace chillerlan\OAuth\Providers\Flickr;
17
18
use chillerlan\OAuth\Core\OAuth1Provider;
19
use Psr\Http\Message\ResponseInterface;
20
21
use function array_merge;
22
use function chillerlan\HTTP\Psr7\merge_query;
23
24
/**
25
 * @method \Psr\Http\Message\ResponseInterface activityUserComments(array $params = ['per_page', 'page'])
26
 * @method \Psr\Http\Message\ResponseInterface activityUserPhotos(array $params = ['timeframe', 'per_page', 'page'])
27
 * @method \Psr\Http\Message\ResponseInterface authCheckToken(array $params = ['auth_token'])
28
 * @method \Psr\Http\Message\ResponseInterface authGetFrob()
29
 * @method \Psr\Http\Message\ResponseInterface authGetFullToken(array $params = ['mini_token'])
30
 * @method \Psr\Http\Message\ResponseInterface authGetToken(array $params = ['frob'])
31
 * @method \Psr\Http\Message\ResponseInterface authOauthCheckToken(array $params = ['oauth_token'])
32
 * @method \Psr\Http\Message\ResponseInterface authOauthGetAccessToken()
33
 * @method \Psr\Http\Message\ResponseInterface blogsGetList(array $params = ['service'])
34
 * @method \Psr\Http\Message\ResponseInterface blogsGetServices()
35
 * @method \Psr\Http\Message\ResponseInterface blogsPostPhoto(array $params = ['blog_id', 'photo_id', 'title', 'description', 'blog_password', 'service'])
36
 * @method \Psr\Http\Message\ResponseInterface camerasGetBrandModels(array $params = ['brand'])
37
 * @method \Psr\Http\Message\ResponseInterface camerasGetBrands()
38
 * @method \Psr\Http\Message\ResponseInterface collectionsGetInfo(array $params = ['collection_id'])
39
 * @method \Psr\Http\Message\ResponseInterface collectionsGetTree(array $params = ['collection_id', 'user_id'])
40
 * @method \Psr\Http\Message\ResponseInterface commonsGetInstitutions()
41
 * @method \Psr\Http\Message\ResponseInterface contactsGetList(array $params = ['filter', 'page', 'per_page', 'sort'])
42
 * @method \Psr\Http\Message\ResponseInterface contactsGetListRecentlyUploaded(array $params = ['date_lastupload', 'filter'])
43
 * @method \Psr\Http\Message\ResponseInterface contactsGetPublicList(array $params = ['user_id', 'page', 'per_page'])
44
 * @method \Psr\Http\Message\ResponseInterface contactsGetTaggingSuggestions(array $params = ['per_page', 'page'])
45
 * @method \Psr\Http\Message\ResponseInterface favoritesAdd(array $params = ['photo_id'])
46
 * @method \Psr\Http\Message\ResponseInterface favoritesGetContext(array $params = ['photo_id', 'user_id'])
47
 * @method \Psr\Http\Message\ResponseInterface favoritesGetList(array $params = ['user_id', 'min_fave_date', 'max_fave_date', 'extras', 'per_page', 'page'])
48
 * @method \Psr\Http\Message\ResponseInterface favoritesGetPublicList(array $params = ['user_id', 'min_fave_date', 'max_fave_date', 'extras', 'per_page', 'page'])
49
 * @method \Psr\Http\Message\ResponseInterface favoritesRemove(array $params = ['photo_id'])
50
 * @method \Psr\Http\Message\ResponseInterface galleriesAddPhoto(array $params = ['gallery_id', 'photo_id', 'comment', 'full_response'])
51
 * @method \Psr\Http\Message\ResponseInterface galleriesCreate(array $params = ['title', 'description', 'primary_photo_id', 'full_result'])
52
 * @method \Psr\Http\Message\ResponseInterface galleriesEditMeta(array $params = ['gallery_id', 'title', 'description'])
53
 * @method \Psr\Http\Message\ResponseInterface galleriesEditPhoto(array $params = ['gallery_id', 'photo_id', 'comment'])
54
 * @method \Psr\Http\Message\ResponseInterface galleriesEditPhotos(array $params = ['gallery_id', 'primary_photo_id', 'photo_ids'])
55
 * @method \Psr\Http\Message\ResponseInterface galleriesGetInfo(array $params = ['gallery_id', 'primary_photo_size', 'cover_photos_size', 'limit', 'short_limit'])
56
 * @method \Psr\Http\Message\ResponseInterface galleriesGetList(array $params = ['user_id', 'per_page', 'page', 'primary_photo_extras', 'continuation', 'sort_groups', 'photo_ids', 'cover_photos', 'primary_photo_cover_size', 'cover_photos_size', 'limit', 'short_limit'])
57
 * @method \Psr\Http\Message\ResponseInterface galleriesGetListForPhoto(array $params = ['photo_id', 'per_page', 'page'])
58
 * @method \Psr\Http\Message\ResponseInterface galleriesGetPhotos(array $params = ['gallery_id', 'continuation', 'per_page', 'get_user_info', 'get_gallery_info', 'extras', 'per_page', 'page'])
59
 * @method \Psr\Http\Message\ResponseInterface galleriesRemovePhoto(array $params = ['gallery_id', 'photo_id', 'full_response'])
60
 * @method \Psr\Http\Message\ResponseInterface groupsBrowse(array $params = ['cat_id'])
61
 * @method \Psr\Http\Message\ResponseInterface groupsDiscussRepliesAdd(array $params = ['group_id', 'topic_id', 'message'])
62
 * @method \Psr\Http\Message\ResponseInterface groupsDiscussRepliesDelete(array $params = ['group_id', 'topic_id', 'reply_id'])
63
 * @method \Psr\Http\Message\ResponseInterface groupsDiscussRepliesEdit(array $params = ['group_id', 'topic_id', 'reply_id', 'message'])
64
 * @method \Psr\Http\Message\ResponseInterface groupsDiscussRepliesGetInfo(array $params = ['group_id', 'topic_id', 'reply_id'])
65
 * @method \Psr\Http\Message\ResponseInterface groupsDiscussRepliesGetList(array $params = ['group_id', 'topic_id', 'per_page', 'page'])
66
 * @method \Psr\Http\Message\ResponseInterface groupsDiscussTopicsAdd(array $params = ['group_id', 'subject', 'message'])
67
 * @method \Psr\Http\Message\ResponseInterface groupsDiscussTopicsGetInfo(array $params = ['group_id', 'topic_id'])
68
 * @method \Psr\Http\Message\ResponseInterface groupsDiscussTopicsGetList(array $params = ['group_id', 'per_page', 'page'])
69
 * @method \Psr\Http\Message\ResponseInterface groupsGetInfo(array $params = ['group_id', 'group_path_alias', 'lang'])
70
 * @method \Psr\Http\Message\ResponseInterface groupsJoin(array $params = ['group_id', 'accept_rules'])
71
 * @method \Psr\Http\Message\ResponseInterface groupsJoinRequest(array $params = ['group_id', 'message', 'accept_rules'])
72
 * @method \Psr\Http\Message\ResponseInterface groupsLeave(array $params = ['group_id', 'delete_photos'])
73
 * @method \Psr\Http\Message\ResponseInterface groupsMembersGetList(array $params = ['group_id', 'membertypes', 'per_page', 'page'])
74
 * @method \Psr\Http\Message\ResponseInterface groupsPoolsAdd(array $params = ['photo_id', 'group_id'])
75
 * @method \Psr\Http\Message\ResponseInterface groupsPoolsGetContext(array $params = ['photo_id', 'group_id'])
76
 * @method \Psr\Http\Message\ResponseInterface groupsPoolsGetGroups(array $params = ['page', 'per_page'])
77
 * @method \Psr\Http\Message\ResponseInterface groupsPoolsGetPhotos(array $params = ['group_id', 'tags', 'user_id', 'extras', 'per_page', 'page'])
78
 * @method \Psr\Http\Message\ResponseInterface groupsPoolsRemove(array $params = ['photo_id', 'group_id'])
79
 * @method \Psr\Http\Message\ResponseInterface groupsSearch(array $params = ['text', 'per_page', 'page'])
80
 * @method \Psr\Http\Message\ResponseInterface interestingnessGetList(array $params = ['date', 'extras', 'per_page', 'page'])
81
 * @method \Psr\Http\Message\ResponseInterface machinetagsGetNamespaces(array $params = ['predicate', 'per_page', 'page'])
82
 * @method \Psr\Http\Message\ResponseInterface machinetagsGetPairs(array $params = ['namespace', 'predicate', 'per_page', 'page'])
83
 * @method \Psr\Http\Message\ResponseInterface machinetagsGetPredicates(array $params = ['namespace', 'per_page', 'page'])
84
 * @method \Psr\Http\Message\ResponseInterface machinetagsGetRecentValues(array $params = ['namespace', 'predicate', 'added_since'])
85
 * @method \Psr\Http\Message\ResponseInterface machinetagsGetValues(array $params = ['namespace', 'predicate', 'per_page', 'page'])
86
 * @method \Psr\Http\Message\ResponseInterface pandaGetList()
87
 * @method \Psr\Http\Message\ResponseInterface pandaGetPhotos(array $params = ['panda_name', 'extras', 'per_page', 'page'])
88
 * @method \Psr\Http\Message\ResponseInterface peopleFindByEmail(array $params = ['find_email'])
89
 * @method \Psr\Http\Message\ResponseInterface peopleFindByUsername(array $params = ['username'])
90
 * @method \Psr\Http\Message\ResponseInterface peopleGetGroups(array $params = ['user_id', 'extras'])
91
 * @method \Psr\Http\Message\ResponseInterface peopleGetInfo(array $params = ['user_id'])
92
 * @method \Psr\Http\Message\ResponseInterface peopleGetLimits()
93
 * @method \Psr\Http\Message\ResponseInterface peopleGetPhotos(array $params = ['user_id', 'safe_search', 'min_upload_date', 'max_upload_date', 'min_taken_date', 'max_taken_date', 'content_type', 'privacy_filter', 'extras', 'per_page', 'page'])
94
 * @method \Psr\Http\Message\ResponseInterface peopleGetPhotosOf(array $params = ['user_id', 'owner_id', 'extras', 'per_page', 'page'])
95
 * @method \Psr\Http\Message\ResponseInterface peopleGetPublicGroups(array $params = ['user_id', 'invitation_only'])
96
 * @method \Psr\Http\Message\ResponseInterface peopleGetPublicPhotos(array $params = ['user_id', 'safe_search', 'extras', 'per_page', 'page'])
97
 * @method \Psr\Http\Message\ResponseInterface peopleGetUploadStatus()
98
 * @method \Psr\Http\Message\ResponseInterface photosAddTags(array $params = ['photo_id', 'tags'])
99
 * @method \Psr\Http\Message\ResponseInterface photosCommentsAddComment(array $params = ['photo_id', 'comment_text'])
100
 * @method \Psr\Http\Message\ResponseInterface photosCommentsDeleteComment(array $params = ['comment_id'])
101
 * @method \Psr\Http\Message\ResponseInterface photosCommentsEditComment(array $params = ['comment_id', 'comment_text'])
102
 * @method \Psr\Http\Message\ResponseInterface photosCommentsGetList(array $params = ['photo_id', 'min_comment_date', 'max_comment_date'])
103
 * @method \Psr\Http\Message\ResponseInterface photosCommentsGetRecentForContacts(array $params = ['date_lastcomment', 'contacts_filter', 'extras', 'per_page', 'page'])
104
 * @method \Psr\Http\Message\ResponseInterface photosDelete(array $params = ['photo_id'])
105
 * @method \Psr\Http\Message\ResponseInterface photosGeoBatchCorrectLocation(array $params = ['lat', 'lon', 'accuracy', 'place_id', 'woe_id'])
106
 * @method \Psr\Http\Message\ResponseInterface photosGeoCorrectLocation(array $params = ['photo_id', 'place_id', 'woe_id', 'foursquare_id'])
107
 * @method \Psr\Http\Message\ResponseInterface photosGeoGetLocation(array $params = ['photo_id', 'extras'])
108
 * @method \Psr\Http\Message\ResponseInterface photosGeoGetPerms(array $params = ['photo_id'])
109
 * @method \Psr\Http\Message\ResponseInterface photosGeoPhotosForLocation(array $params = ['lat', 'lon', 'accuracy', 'extras', 'per_page', 'page'])
110
 * @method \Psr\Http\Message\ResponseInterface photosGeoRemoveLocation(array $params = ['photo_id'])
111
 * @method \Psr\Http\Message\ResponseInterface photosGeoSetContext(array $params = ['photo_id', 'context'])
112
 * @method \Psr\Http\Message\ResponseInterface photosGeoSetLocation(array $params = ['photo_id', 'lat', 'lon', 'accuracy', 'context'])
113
 * @method \Psr\Http\Message\ResponseInterface photosGeoSetPerms(array $params = ['is_public', 'is_contact', 'is_friend', 'is_family', 'photo_id'])
114
 * @method \Psr\Http\Message\ResponseInterface photosGetAllContexts(array $params = ['photo_id'])
115
 * @method \Psr\Http\Message\ResponseInterface photosGetContactsPhotos(array $params = ['count', 'just_friends', 'single_photo', 'include_self', 'extras'])
116
 * @method \Psr\Http\Message\ResponseInterface photosGetContactsPublicPhotos(array $params = ['user_id', 'count', 'just_friends', 'single_photo', 'include_self', 'extras'])
117
 * @method \Psr\Http\Message\ResponseInterface photosGetContext(array $params = ['photo_id'])
118
 * @method \Psr\Http\Message\ResponseInterface photosGetCounts(array $params = ['dates', 'taken_dates'])
119
 * @method \Psr\Http\Message\ResponseInterface photosGetExif(array $params = ['photo_id', 'secret'])
120
 * @method \Psr\Http\Message\ResponseInterface photosGetFavorites(array $params = ['photo_id', 'page', 'per_page'])
121
 * @method \Psr\Http\Message\ResponseInterface photosGetInfo(array $params = ['photo_id', 'secret'])
122
 * @method \Psr\Http\Message\ResponseInterface photosGetNotInSet(array $params = ['max_upload_date', 'min_taken_date', 'max_taken_date', 'privacy_filter', 'media', 'min_upload_date', 'extras', 'per_page', 'page'])
123
 * @method \Psr\Http\Message\ResponseInterface photosGetPerms(array $params = ['photo_id'])
124
 * @method \Psr\Http\Message\ResponseInterface photosGetPopular(array $params = ['user_id', 'sort', 'extras', 'per_page', 'page'])
125
 * @method \Psr\Http\Message\ResponseInterface photosGetRecent(array $params = ['extras', 'per_page', 'page'])
126
 * @method \Psr\Http\Message\ResponseInterface photosGetSizes(array $params = ['photo_id'])
127
 * @method \Psr\Http\Message\ResponseInterface photosGetUntagged(array $params = ['min_upload_date', 'max_upload_date', 'min_taken_date', 'max_taken_date', 'privacy_filter', 'media', 'extras', 'per_page', 'page'])
128
 * @method \Psr\Http\Message\ResponseInterface photosGetWithGeoData(array $params = ['min_upload_date', 'max_upload_date', 'min_taken_date', 'max_taken_date', 'privacy_filter', 'sort', 'media', 'extras', 'per_page', 'page'])
129
 * @method \Psr\Http\Message\ResponseInterface photosGetWithoutGeoData(array $params = ['max_upload_date', 'min_taken_date', 'max_taken_date', 'privacy_filter', 'sort', 'media', 'min_upload_date', 'extras', 'per_page', 'page'])
130
 * @method \Psr\Http\Message\ResponseInterface photosLicensesGetInfo()
131
 * @method \Psr\Http\Message\ResponseInterface photosLicensesSetLicense(array $params = ['photo_id', 'license_id'])
132
 * @method \Psr\Http\Message\ResponseInterface photosNotesAdd(array $params = ['photo_id', 'note_x', 'note_y', 'note_w', 'note_h', 'note_text'])
133
 * @method \Psr\Http\Message\ResponseInterface photosNotesDelete(array $params = ['note_id'])
134
 * @method \Psr\Http\Message\ResponseInterface photosNotesEdit(array $params = ['note_id', 'note_x', 'note_y', 'note_w', 'note_h', 'note_text'])
135
 * @method \Psr\Http\Message\ResponseInterface photosPeopleAdd(array $params = ['photo_id', 'user_id', 'person_x', 'person_y', 'person_w', 'person_h'])
136
 * @method \Psr\Http\Message\ResponseInterface photosPeopleDelete(array $params = ['photo_id', 'user_id'])
137
 * @method \Psr\Http\Message\ResponseInterface photosPeopleDeleteCoords(array $params = ['photo_id', 'user_id'])
138
 * @method \Psr\Http\Message\ResponseInterface photosPeopleEditCoords(array $params = ['photo_id', 'user_id', 'person_x', 'person_y', 'person_w', 'person_h'])
139
 * @method \Psr\Http\Message\ResponseInterface photosPeopleGetList(array $params = ['photo_id'])
140
 * @method \Psr\Http\Message\ResponseInterface photosRecentlyUpdated(array $params = ['min_date', 'extras', 'per_page', 'page'])
141
 * @method \Psr\Http\Message\ResponseInterface photosRemoveTag(array $params = ['tag_id'])
142
 * @method \Psr\Http\Message\ResponseInterface photosSearch(array $params = ['user_id', 'tags', 'tag_mode', 'text', 'min_upload_date', 'max_upload_date', 'min_taken_date', 'max_taken_date', 'license', 'sort', 'privacy_filter', 'bbox', 'accuracy', 'safe_search', 'content_type', 'machine_tags', 'machine_tag_mode', 'group_id', 'contacts', 'woe_id', 'place_id', 'media', 'has_geo', 'geo_context', 'lat', 'lon', 'radius', 'radius_units', 'is_commons', 'in_gallery', 'is_getty', 'extras', 'per_page', 'page'])
143
 * @method \Psr\Http\Message\ResponseInterface photosSetContentType(array $params = ['photo_id', 'content_type'])
144
 * @method \Psr\Http\Message\ResponseInterface photosSetDates(array $params = ['photo_id', 'date_posted', 'date_taken', 'date_taken_granularity'])
145
 * @method \Psr\Http\Message\ResponseInterface photosSetMeta(array $params = ['photo_id', 'title', 'description'])
146
 * @method \Psr\Http\Message\ResponseInterface photosSetPerms(array $params = ['photo_id', 'is_public', 'is_friend', 'is_family', 'perm_comment', 'perm_addmeta'])
147
 * @method \Psr\Http\Message\ResponseInterface photosSetSafetyLevel(array $params = ['photo_id', 'safety_level', 'hidden'])
148
 * @method \Psr\Http\Message\ResponseInterface photosSetTags(array $params = ['photo_id', 'tags'])
149
 * @method \Psr\Http\Message\ResponseInterface photosSuggestionsApproveSuggestion(array $params = ['suggestion_id'])
150
 * @method \Psr\Http\Message\ResponseInterface photosSuggestionsGetList(array $params = ['photo_id', 'status_id'])
151
 * @method \Psr\Http\Message\ResponseInterface photosSuggestionsRejectSuggestion(array $params = ['suggestion_id'])
152
 * @method \Psr\Http\Message\ResponseInterface photosSuggestionsRemoveSuggestion(array $params = ['suggestion_id'])
153
 * @method \Psr\Http\Message\ResponseInterface photosSuggestionsSuggestLocation(array $params = ['photo_id', 'lat', 'lon', 'accuracy', 'woe_id', 'place_id', 'note'])
154
 * @method \Psr\Http\Message\ResponseInterface photosTransformRotate(array $params = ['photo_id', 'degrees'])
155
 * @method \Psr\Http\Message\ResponseInterface photosUploadCheckTickets(array $params = ['tickets'])
156
 * @method \Psr\Http\Message\ResponseInterface photosetsAddPhoto(array $params = ['photoset_id', 'photo_id'])
157
 * @method \Psr\Http\Message\ResponseInterface photosetsCommentsAddComment(array $params = ['photoset_id', 'comment_text'])
158
 * @method \Psr\Http\Message\ResponseInterface photosetsCommentsDeleteComment(array $params = ['comment_id'])
159
 * @method \Psr\Http\Message\ResponseInterface photosetsCommentsEditComment(array $params = ['comment_id', 'comment_text'])
160
 * @method \Psr\Http\Message\ResponseInterface photosetsCommentsGetList(array $params = ['photoset_id'])
161
 * @method \Psr\Http\Message\ResponseInterface photosetsCreate(array $params = ['title', 'description', 'primary_photo_id'])
162
 * @method \Psr\Http\Message\ResponseInterface photosetsDelete(array $params = ['photoset_id'])
163
 * @method \Psr\Http\Message\ResponseInterface photosetsEditMeta(array $params = ['photoset_id', 'title', 'description'])
164
 * @method \Psr\Http\Message\ResponseInterface photosetsEditPhotos(array $params = ['photoset_id', 'primary_photo_id', 'photo_ids'])
165
 * @method \Psr\Http\Message\ResponseInterface photosetsGetContext(array $params = ['photo_id', 'photoset_id'])
166
 * @method \Psr\Http\Message\ResponseInterface photosetsGetInfo(array $params = ['photoset_id', 'user_id'])
167
 * @method \Psr\Http\Message\ResponseInterface photosetsGetList(array $params = ['user_id', 'page', 'per_page', 'primary_photo_extras', 'photo_ids', 'sort_groups'])
168
 * @method \Psr\Http\Message\ResponseInterface photosetsGetPhotos(array $params = ['photoset_id', 'user_id', 'extras', 'per_page', 'page', 'privacy_filter', 'media'])
169
 * @method \Psr\Http\Message\ResponseInterface photosetsOrderSets(array $params = ['photoset_ids'])
170
 * @method \Psr\Http\Message\ResponseInterface photosetsRemovePhoto(array $params = ['photoset_id', 'photo_id'])
171
 * @method \Psr\Http\Message\ResponseInterface photosetsRemovePhotos(array $params = ['photoset_id', 'photo_ids'])
172
 * @method \Psr\Http\Message\ResponseInterface photosetsReorderPhotos(array $params = ['photoset_id', 'photo_ids'])
173
 * @method \Psr\Http\Message\ResponseInterface photosetsSetPrimaryPhoto(array $params = ['photoset_id', 'photo_id'])
174
 * @method \Psr\Http\Message\ResponseInterface placesFind(array $params = ['query'])
175
 * @method \Psr\Http\Message\ResponseInterface placesFindByLatLon(array $params = ['lat', 'lon', 'accuracy'])
176
 * @method \Psr\Http\Message\ResponseInterface placesGetChildrenWithPhotosPublic(array $params = ['place_id', 'woe_id'])
177
 * @method \Psr\Http\Message\ResponseInterface placesGetInfo(array $params = ['place_id', 'woe_id'])
178
 * @method \Psr\Http\Message\ResponseInterface placesGetInfoByUrl(array $params = ['url'])
179
 * @method \Psr\Http\Message\ResponseInterface placesGetPlaceTypes()
180
 * @method \Psr\Http\Message\ResponseInterface placesGetShapeHistory(array $params = ['place_id', 'woe_id'])
181
 * @method \Psr\Http\Message\ResponseInterface placesGetTopPlacesList(array $params = ['place_type_id', 'date', 'woe_id', 'place_id'])
182
 * @method \Psr\Http\Message\ResponseInterface placesPlacesForBoundingBox(array $params = ['bbox', 'place_type', 'place_type_id'])
183
 * @method \Psr\Http\Message\ResponseInterface placesPlacesForContacts(array $params = ['place_type', 'place_type_id', 'woe_id', 'place_id', 'threshold', 'contacts', 'min_upload_date', 'max_upload_date', 'min_taken_date', 'max_taken_date'])
184
 * @method \Psr\Http\Message\ResponseInterface placesPlacesForTags(array $params = ['place_type_id', 'woe_id', 'place_id', 'threshold', 'tags', 'tag_mode', 'machine_tags', 'machine_tag_mode', 'min_upload_date', 'max_upload_date', 'min_taken_date', 'max_taken_date'])
185
 * @method \Psr\Http\Message\ResponseInterface placesPlacesForUser(array $params = ['place_type_id', 'place_type', 'woe_id', 'place_id', 'threshold', 'min_upload_date', 'max_upload_date', 'min_taken_date', 'max_taken_date'])
186
 * @method \Psr\Http\Message\ResponseInterface placesResolvePlaceId(array $params = ['place_id'])
187
 * @method \Psr\Http\Message\ResponseInterface placesResolvePlaceURL(array $params = ['url'])
188
 * @method \Psr\Http\Message\ResponseInterface placesTagsForPlace(array $params = ['woe_id', 'place_id', 'min_upload_date', 'max_upload_date', 'min_taken_date', 'max_taken_date'])
189
 * @method \Psr\Http\Message\ResponseInterface prefsGetContentType()
190
 * @method \Psr\Http\Message\ResponseInterface prefsGetGeoPerms()
191
 * @method \Psr\Http\Message\ResponseInterface prefsGetHidden()
192
 * @method \Psr\Http\Message\ResponseInterface prefsGetPrivacy()
193
 * @method \Psr\Http\Message\ResponseInterface prefsGetSafetyLevel()
194
 * @method \Psr\Http\Message\ResponseInterface profileGetProfile(array $params = ['user_id'])
195
 * @method \Psr\Http\Message\ResponseInterface pushGetSubscriptions()
196
 * @method \Psr\Http\Message\ResponseInterface pushGetTopics()
197
 * @method \Psr\Http\Message\ResponseInterface pushSubscribe(array $params = ['topic', 'callback', 'verify', 'verify_token', 'lease_seconds', 'woe_ids', 'place_ids', 'lat', 'lon', 'radius', 'radius_units', 'accuracy', 'nsids', 'tags'])
198
 * @method \Psr\Http\Message\ResponseInterface pushUnsubscribe(array $params = ['topic', 'callback', 'verify', 'verify_token'])
199
 * @method \Psr\Http\Message\ResponseInterface reflectionGetMethodInfo(array $params = ['method_name'])
200
 * @method \Psr\Http\Message\ResponseInterface reflectionGetMethods()
201
 * @method \Psr\Http\Message\ResponseInterface statsGetCSVFiles()
202
 * @method \Psr\Http\Message\ResponseInterface statsGetCollectionDomains(array $params = ['date', 'collection_id', 'per_page', 'page'])
203
 * @method \Psr\Http\Message\ResponseInterface statsGetCollectionReferrers(array $params = ['date', 'domain', 'collection_id', 'per_page', 'page'])
204
 * @method \Psr\Http\Message\ResponseInterface statsGetCollectionStats(array $params = ['date', 'collection_id'])
205
 * @method \Psr\Http\Message\ResponseInterface statsGetPhotoDomains(array $params = ['date', 'photo_id', 'per_page', 'page'])
206
 * @method \Psr\Http\Message\ResponseInterface statsGetPhotoReferrers(array $params = ['date', 'domain', 'photo_id', 'per_page', 'page'])
207
 * @method \Psr\Http\Message\ResponseInterface statsGetPhotoStats(array $params = ['date', 'photo_id'])
208
 * @method \Psr\Http\Message\ResponseInterface statsGetPhotosetDomains(array $params = ['date', 'photoset_id', 'per_page', 'page'])
209
 * @method \Psr\Http\Message\ResponseInterface statsGetPhotosetReferrers(array $params = ['date', 'domain', 'photoset_id', 'per_page', 'page'])
210
 * @method \Psr\Http\Message\ResponseInterface statsGetPhotosetStats(array $params = ['date', 'photoset_id'])
211
 * @method \Psr\Http\Message\ResponseInterface statsGetPhotostreamDomains(array $params = ['date', 'per_page', 'page'])
212
 * @method \Psr\Http\Message\ResponseInterface statsGetPhotostreamReferrers(array $params = ['date', 'domain', 'per_page', 'page'])
213
 * @method \Psr\Http\Message\ResponseInterface statsGetPhotostreamStats(array $params = ['date'])
214
 * @method \Psr\Http\Message\ResponseInterface statsGetPopularPhotos(array $params = ['date', 'sort', 'per_page', 'page'])
215
 * @method \Psr\Http\Message\ResponseInterface statsGetTotalViews(array $params = ['date'])
216
 * @method \Psr\Http\Message\ResponseInterface tagsGetClusterPhotos(array $params = ['tag', 'cluster_id'])
217
 * @method \Psr\Http\Message\ResponseInterface tagsGetClusters(array $params = ['tag'])
218
 * @method \Psr\Http\Message\ResponseInterface tagsGetHotList(array $params = ['period', 'count'])
219
 * @method \Psr\Http\Message\ResponseInterface tagsGetListPhoto(array $params = ['photo_id'])
220
 * @method \Psr\Http\Message\ResponseInterface tagsGetListUser(array $params = ['user_id'])
221
 * @method \Psr\Http\Message\ResponseInterface tagsGetListUserPopular(array $params = ['user_id', 'count'])
222
 * @method \Psr\Http\Message\ResponseInterface tagsGetListUserRaw(array $params = ['tag'])
223
 * @method \Psr\Http\Message\ResponseInterface tagsGetMostFrequentlyUsed()
224
 * @method \Psr\Http\Message\ResponseInterface tagsGetRelated(array $params = ['tag'])
225
 * @method \Psr\Http\Message\ResponseInterface testEcho()
226
 * @method \Psr\Http\Message\ResponseInterface testLogin()
227
 * @method \Psr\Http\Message\ResponseInterface testNull()
228
 * @method \Psr\Http\Message\ResponseInterface testimonialsAddTestimonial(array $params = ['user_id', 'testimonial_text'])
229
 * @method \Psr\Http\Message\ResponseInterface testimonialsApproveTestimonial(array $params = ['testimonial_id'])
230
 * @method \Psr\Http\Message\ResponseInterface testimonialsDeleteTestimonial(array $params = ['testimonial_id'])
231
 * @method \Psr\Http\Message\ResponseInterface testimonialsEditTestimonial(array $params = ['user_id', 'testimonial_id', 'testimonial_text'])
232
 * @method \Psr\Http\Message\ResponseInterface testimonialsGetAllTestimonialsAbout(array $params = ['page', 'per_page'])
233
 * @method \Psr\Http\Message\ResponseInterface testimonialsGetAllTestimonialsAboutBy(array $params = ['user_id'])
234
 * @method \Psr\Http\Message\ResponseInterface testimonialsGetAllTestimonialsBy(array $params = ['page', 'per_page'])
235
 * @method \Psr\Http\Message\ResponseInterface testimonialsGetPendingTestimonialsAbout(array $params = ['page', 'per_page'])
236
 * @method \Psr\Http\Message\ResponseInterface testimonialsGetPendingTestimonialsAboutBy(array $params = ['user_id'])
237
 * @method \Psr\Http\Message\ResponseInterface testimonialsGetPendingTestimonialsBy(array $params = ['page', 'per_page'])
238
 * @method \Psr\Http\Message\ResponseInterface testimonialsGetTestimonialsAbout(array $params = ['user_id', 'page', 'per_page'])
239
 * @method \Psr\Http\Message\ResponseInterface testimonialsGetTestimonialsAboutBy(array $params = ['user_id'])
240
 * @method \Psr\Http\Message\ResponseInterface testimonialsGetTestimonialsBy(array $params = ['user_id', 'page', 'per_page'])
241
 * @method \Psr\Http\Message\ResponseInterface urlsGetGroup(array $params = ['group_id'])
242
 * @method \Psr\Http\Message\ResponseInterface urlsGetUserPhotos(array $params = ['user_id'])
243
 * @method \Psr\Http\Message\ResponseInterface urlsGetUserProfile(array $params = ['user_id'])
244
 * @method \Psr\Http\Message\ResponseInterface urlsLookupGallery(array $params = ['url'])
245
 * @method \Psr\Http\Message\ResponseInterface urlsLookupGroup(array $params = ['url'])
246
 * @method \Psr\Http\Message\ResponseInterface urlsLookupUser(array $params = ['url'])
247
 */
248
class Flickr extends OAuth1Provider{
249
250
	public const PERM_READ   = 'read';
251
	public const PERM_WRITE  = 'write';
252
	public const PERM_DELETE = 'delete';
253
254
	protected string $requestTokenURL = 'https://www.flickr.com/services/oauth/request_token';
255
	protected string $authURL         = 'https://www.flickr.com/services/oauth/authorize';
256
	protected string $accessTokenURL  = 'https://www.flickr.com/services/oauth/access_token';
257
	protected ?string $apiURL          = 'https://api.flickr.com/services/rest';
258
	protected ?string $userRevokeURL   = 'https://www.flickr.com/services/auth/list.gne';
259
	protected ?string $endpointMap     = FlickrEndpoints::class;
260
	protected ?string $apiDocs         = 'https://www.flickr.com/services/api/';
261
	protected ?string $applicationURL  = 'https://www.flickr.com/services/apps/create/';
262
263
	/**
264
	 * @inheritDoc
265
	 */
266
	public function request(
267
		string $path,
268
		array $params = null,
269
		string $method = null,
270
		$body = null,
271
		array $headers = null
272
	):ResponseInterface{
273
274
		$params = array_merge($params ?? [], [
275
			'method'         => $path,
276
			'format'         => 'json',
277
			'nojsoncallback' => true,
278
		]);
279
280
		$request = $this->getRequestAuthorization(
281
			/** @phan-suppress-next-line PhanTypeMismatchArgumentNullable */
282
			$this->requestFactory->createRequest($method ?? 'POST', merge_query($this->apiURL, $params)),
0 ignored issues
show
Bug introduced by
It seems like $this->apiURL can also be of type null; however, parameter $uri of chillerlan\HTTP\Psr7\merge_query() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

282
			$this->requestFactory->createRequest($method ?? 'POST', merge_query(/** @scrutinizer ignore-type */ $this->apiURL, $params)),
Loading history...
283
			$this->storage->getAccessToken($this->serviceName)
284
		);
285
286
		return $this->http->sendRequest($request);
287
	}
288
289
}
290