@@ -8,8 +8,8 @@ public function __construct($token)
8
8
}
9
9
10
10
/**
11
- * @throws NotFoundException
12
- * @throws BadResponseException
11
+ * @throws Exceptions\ NotFoundException
12
+ * @throws Exceptions\ BadResponseException
13
13
*/
14
14
protected function request ($ method , $ data )
15
15
{
@@ -18,18 +18,18 @@ protected function request($method, $data)
18
18
if ($ response ['response ' ]['status_code ' ] == 200 && $ response ['response ' ]['content_type ' ] == 'application/json ' ) {
19
19
return $ response ['response ' ]['body ' ];
20
20
} else if ($ response ['response ' ]['status_code ' ] == 404 ) {
21
- throw new NotFoundException ('Instagram resource not found ' );
21
+ throw new Exceptions \ NotFoundException ('Instagram resource not found ' );
22
22
} else {
23
- throw new BadResponseException ('Bad response from Instagram ' );
23
+ throw new Exceptions \ BadResponseException ('Bad response from Instagram ' );
24
24
}
25
25
} else {
26
- throw new BadResponseException ('Bad response from RocketAPI ' );
26
+ throw new Exceptions \ BadResponseException ('Bad response from RocketAPI ' );
27
27
}
28
28
}
29
29
30
30
/**
31
- * @throws NotFoundException
32
- * @throws BadResponseException
31
+ * @throws Exceptions\ NotFoundException
32
+ * @throws Exceptions\ BadResponseException
33
33
*/
34
34
public function search ($ query ) {
35
35
return $ this ->request ('instagram/search ' , [
@@ -38,8 +38,8 @@ public function search($query) {
38
38
}
39
39
40
40
/**
41
- * @throws NotFoundException
42
- * @throws BadResponseException
41
+ * @throws Exceptions\ NotFoundException
42
+ * @throws Exceptions\ BadResponseException
43
43
*/
44
44
public function getUserInfo ($ username ) {
45
45
return $ this ->request ('instagram/user/get_info ' , [
@@ -48,8 +48,8 @@ public function getUserInfo($username) {
48
48
}
49
49
50
50
/**
51
- * @throws NotFoundException
52
- * @throws BadResponseException
51
+ * @throws Exceptions\ NotFoundException
52
+ * @throws Exceptions\ BadResponseException
53
53
*/
54
54
public function getUserInfoById ($ user_id ) {
55
55
return $ this ->request ('instagram/user/get_info_by_id ' , [
@@ -58,8 +58,8 @@ public function getUserInfoById($user_id) {
58
58
}
59
59
60
60
/**
61
- * @throws NotFoundException
62
- * @throws BadResponseException
61
+ * @throws Exceptions\ NotFoundException
62
+ * @throws Exceptions\ BadResponseException
63
63
*/
64
64
public function getUserMedia ($ user_id , $ count =12 , $ max_id =null ) {
65
65
$ payload = ['id ' => $ user_id , 'count ' => $ count ];
@@ -70,8 +70,8 @@ public function getUserMedia($user_id, $count=12, $max_id=null) {
70
70
}
71
71
72
72
/**
73
- * @throws NotFoundException
74
- * @throws BadResponseException
73
+ * @throws Exceptions\ NotFoundException
74
+ * @throws Exceptions\ BadResponseException
75
75
*/
76
76
public function getUserFollowing ($ user_id , $ count =12 , $ max_id =null ) {
77
77
$ payload = ['id ' => $ user_id , 'count ' => $ count ];
@@ -82,8 +82,8 @@ public function getUserFollowing($user_id, $count=12, $max_id=null) {
82
82
}
83
83
84
84
/**
85
- * @throws NotFoundException
86
- * @throws BadResponseException
85
+ * @throws Exceptions\ NotFoundException
86
+ * @throws Exceptions\ BadResponseException
87
87
*/
88
88
public function getUserFollowers ($ user_id , $ count =12 , $ max_id =null )
89
89
{
@@ -95,8 +95,8 @@ public function getUserFollowers($user_id, $count=12, $max_id=null)
95
95
}
96
96
97
97
/**
98
- * @throws NotFoundException
99
- * @throws BadResponseException
98
+ * @throws Exceptions\ NotFoundException
99
+ * @throws Exceptions\ BadResponseException
100
100
*/
101
101
public function searchUserFollowers ($ user_id , $ query ) {
102
102
return $ this ->request ('instagram/user/get_followers ' , [
@@ -106,8 +106,8 @@ public function searchUserFollowers($user_id, $query) {
106
106
}
107
107
108
108
/**
109
- * @throws NotFoundException
110
- * @throws BadResponseException
109
+ * @throws Exceptions\ NotFoundException
110
+ * @throws Exceptions\ BadResponseException
111
111
*/
112
112
public function getUserStoriesBulk ($ user_ids ) {
113
113
return $ this ->request ('instagram/user/get_stories ' , [
@@ -116,16 +116,16 @@ public function getUserStoriesBulk($user_ids) {
116
116
}
117
117
118
118
/**
119
- * @throws NotFoundException
120
- * @throws BadResponseException
119
+ * @throws Exceptions\ NotFoundException
120
+ * @throws Exceptions\ BadResponseException
121
121
*/
122
122
public function getUserStories ($ user_id ) {
123
123
return $ this ->getUserStoriesBulk ([$ user_id ]);
124
124
}
125
125
126
126
/**
127
- * @throws NotFoundException
128
- * @throws BadResponseException
127
+ * @throws Exceptions\ NotFoundException
128
+ * @throws Exceptions\ BadResponseException
129
129
*/
130
130
public function getMediaInfo ($ media_id ) {
131
131
return $ this ->request ('instagram/media/get_info ' , [
@@ -134,8 +134,8 @@ public function getMediaInfo($media_id) {
134
134
}
135
135
136
136
/**
137
- * @throws NotFoundException
138
- * @throws BadResponseException
137
+ * @throws Exceptions\ NotFoundException
138
+ * @throws Exceptions\ BadResponseException
139
139
*/
140
140
public function getMediaLikes ($ shortcode , $ count =12 , $ max_id =null ) {
141
141
$ payload = ['shortcode ' => $ shortcode , 'count ' => $ count ];
@@ -146,8 +146,8 @@ public function getMediaLikes($shortcode, $count=12, $max_id=null) {
146
146
}
147
147
148
148
/**
149
- * @throws NotFoundException
150
- * @throws BadResponseException
149
+ * @throws Exceptions\ NotFoundException
150
+ * @throws Exceptions\ BadResponseException
151
151
*/
152
152
public function getMediaComments ($ media_id , $ can_support_threading =true , $ min_id =null ) {
153
153
$ payload = ['id ' => $ media_id , 'can_support_threading ' => $ can_support_threading ];
@@ -158,8 +158,8 @@ public function getMediaComments($media_id, $can_support_threading=true, $min_id
158
158
}
159
159
160
160
/**
161
- * @throws NotFoundException
162
- * @throws BadResponseException
161
+ * @throws Exceptions\ NotFoundException
162
+ * @throws Exceptions\ BadResponseException
163
163
*/
164
164
public function getCommentLikes ($ comment_id , $ max_id =null ) {
165
165
$ payload = ['id ' => $ comment_id ];
0 commit comments