@@ -161,7 +161,7 @@ public function get_growth_stats(\DateTime $starting = null, \DateTime $ending =
161
161
*
162
162
* @see https://developers.convertkit.com/v4.html#convertkit-api-forms
163
163
*
164
- * @return false |array<int,\stdClass>
164
+ * @return mixed |array<int,\stdClass>
165
165
*/
166
166
public function get_forms (
167
167
string $ status = 'active ' ,
@@ -198,7 +198,7 @@ public function get_forms(
198
198
*
199
199
* @see https://developers.convertkit.com/v4.html#convertkit-api-forms
200
200
*
201
- * @return false |array<int,\stdClass>
201
+ * @return mixed |array<int,\stdClass>
202
202
*/
203
203
public function get_landing_pages (
204
204
string $ status = 'active ' ,
@@ -456,7 +456,7 @@ public function get_sequence_subscriptions(
456
456
*
457
457
* @see https://developers.convertkit.com/v4.html#list-tags
458
458
*
459
- * @return false |array<int,\stdClass>
459
+ * @return mixed |array<int,\stdClass>
460
460
*/
461
461
public function get_tags (
462
462
bool $ include_total_count = false ,
@@ -863,10 +863,26 @@ public function get_subscriber_id(string $email_address)
863
863
['email_address ' => $ email_address ]
864
864
);
865
865
866
+ if (!$ subscribers instanceof \stdClass) {
867
+ return false ;
868
+ }
869
+
870
+ if (!is_array ($ subscribers ->subscribers )) {
871
+ return false ;
872
+ }
873
+
866
874
if (!count ($ subscribers ->subscribers )) {
867
875
return false ;
868
876
}
869
877
878
+ if (!$ subscribers ->subscribers [0 ] instanceof \stdClass) {
879
+ return false ;
880
+ }
881
+
882
+ if (!is_int ($ subscribers ->subscribers [0 ]->id )) {
883
+ return false ;
884
+ }
885
+
870
886
// Return the subscriber's ID.
871
887
return $ subscribers ->subscribers [0 ]->id ;
872
888
}
@@ -878,7 +894,7 @@ public function get_subscriber_id(string $email_address)
878
894
*
879
895
* @see https://developers.convertkit.com/v4.html#get-a-subscriber
880
896
*
881
- * @return false |integer
897
+ * @return mixed |integer
882
898
*/
883
899
public function get_subscriber (int $ subscriber_id )
884
900
{
@@ -895,7 +911,7 @@ public function get_subscriber(int $subscriber_id)
895
911
*
896
912
* @see https://developers.convertkit.com/v4.html#update-a-subscriber
897
913
*
898
- * @return false| mixed
914
+ * @return mixed
899
915
*/
900
916
public function update_subscriber (
901
917
int $ subscriber_id ,
@@ -930,7 +946,7 @@ public function update_subscriber(
930
946
*
931
947
* @see https://developers.convertkit.com/v4.html#unsubscribe-subscriber
932
948
*
933
- * @return false |object
949
+ * @return mixed |object
934
950
*/
935
951
public function unsubscribe_by_email (string $ email_address )
936
952
{
@@ -949,7 +965,7 @@ public function unsubscribe_by_email(string $email_address)
949
965
*
950
966
* @see https://developers.convertkit.com/v4.html#unsubscribe-subscriber
951
967
*
952
- * @return false |object
968
+ * @return mixed |object
953
969
*/
954
970
public function unsubscribe (int $ subscriber_id )
955
971
{
@@ -967,7 +983,7 @@ public function unsubscribe(int $subscriber_id)
967
983
*
968
984
* @see https://developers.convertkit.com/v4.html#list-tags-for-a-subscriber
969
985
*
970
- * @return false |array<int,\stdClass>
986
+ * @return mixed |array<int,\stdClass>
971
987
*/
972
988
public function get_subscriber_tags (
973
989
int $ subscriber_id ,
@@ -1044,7 +1060,7 @@ public function get_broadcasts(
1044
1060
*
1045
1061
* @see https://developers.convertkit.com/v4.html#create-a-broadcast
1046
1062
*
1047
- * @return false |object
1063
+ * @return mixed |object
1048
1064
*/
1049
1065
public function create_broadcast (
1050
1066
string $ subject = '' ,
@@ -1103,7 +1119,7 @@ public function create_broadcast(
1103
1119
*
1104
1120
* @see https://developers.convertkit.com/v4.html#get-a-broadcast
1105
1121
*
1106
- * @return false |object
1122
+ * @return mixed |object
1107
1123
*/
1108
1124
public function get_broadcast (int $ id )
1109
1125
{
@@ -1118,7 +1134,7 @@ public function get_broadcast(int $id)
1118
1134
*
1119
1135
* @see https://developers.convertkit.com/v4.html#get-stats
1120
1136
*
1121
- * @return false |object
1137
+ * @return mixed |object
1122
1138
*/
1123
1139
public function get_broadcast_stats (int $ id )
1124
1140
{
@@ -1151,7 +1167,7 @@ public function get_broadcast_stats(int $id)
1151
1167
*
1152
1168
* @see https://developers.convertkit.com/#create-a-broadcast
1153
1169
*
1154
- * @return false |object
1170
+ * @return mixed |object
1155
1171
*/
1156
1172
public function update_broadcast (
1157
1173
int $ id ,
@@ -1213,7 +1229,7 @@ public function update_broadcast(
1213
1229
*
1214
1230
* @see https://developers.convertkit.com/v4.html#delete-a-broadcast
1215
1231
*
1216
- * @return false |object
1232
+ * @return mixed |object
1217
1233
*/
1218
1234
public function delete_broadcast (int $ id )
1219
1235
{
@@ -1266,7 +1282,7 @@ public function get_webhooks(
1266
1282
*
1267
1283
* @throws \InvalidArgumentException If the event is not supported.
1268
1284
*
1269
- * @return false |object
1285
+ * @return mixed |object
1270
1286
*/
1271
1287
public function create_webhook (string $ url , string $ event , string $ parameter = '' )
1272
1288
{
@@ -1340,7 +1356,7 @@ public function create_webhook(string $url, string $event, string $parameter = '
1340
1356
*
1341
1357
* @see https://developers.convertkit.com/v4.html#delete-a-webhook
1342
1358
*
1343
- * @return false |object
1359
+ * @return mixed |object
1344
1360
*/
1345
1361
public function delete_webhook (int $ id )
1346
1362
{
@@ -1389,7 +1405,7 @@ public function get_custom_fields(
1389
1405
*
1390
1406
* @see https://developers.convertkit.com/v4.html#create-a-custom-field
1391
1407
*
1392
- * @return false |object
1408
+ * @return mixed |object
1393
1409
*/
1394
1410
public function create_custom_field (string $ label )
1395
1411
{
@@ -1409,7 +1425,7 @@ public function create_custom_field(string $label)
1409
1425
*
1410
1426
* @see https://developers.convertkit.com/v4.html#bulk-create-custom-fields
1411
1427
*
1412
- * @return false |object
1428
+ * @return mixed |object
1413
1429
*/
1414
1430
public function create_custom_fields (array $ labels , string $ callback_url = '' )
1415
1431
{
@@ -1444,7 +1460,7 @@ public function create_custom_fields(array $labels, string $callback_url = '')
1444
1460
*
1445
1461
* @see https://developers.convertkit.com/v4.html#update-a-custom-field
1446
1462
*
1447
- * @return false |object
1463
+ * @return mixed |object
1448
1464
*/
1449
1465
public function update_custom_field (int $ id , string $ label )
1450
1466
{
@@ -1463,7 +1479,7 @@ public function update_custom_field(int $id, string $label)
1463
1479
*
1464
1480
* @see https://developers.convertkit.com/#destroy-field
1465
1481
*
1466
- * @return false |object
1482
+ * @return mixed |object
1467
1483
*/
1468
1484
public function delete_custom_field (int $ id )
1469
1485
{
@@ -1510,7 +1526,7 @@ public function get_purchases(
1510
1526
*
1511
1527
* @see https://developers.convertkit.com/v4.html#get-a-purchase
1512
1528
*
1513
- * @return false |object
1529
+ * @return mixed |object
1514
1530
*/
1515
1531
public function get_purchase (int $ purchase_id )
1516
1532
{
@@ -1535,7 +1551,7 @@ public function get_purchase(int $purchase_id)
1535
1551
*
1536
1552
* @see https://developers.convertkit.com/v4.html#create-a-purchase
1537
1553
*
1538
- * @return false |object
1554
+ * @return mixed |object
1539
1555
*/
1540
1556
public function create_purchase (
1541
1557
string $ email_address ,
0 commit comments