Skip to content

Commit

Permalink
set php version
Browse files Browse the repository at this point in the history
  • Loading branch information
ANKUR DWIVEDI authored and ANKUR DWIVEDI committed Feb 20, 2024
1 parent 3731864 commit b4b888a
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 29 deletions.
3 changes: 2 additions & 1 deletion src/ImageKit/ImageKit.php
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,8 @@ public function getBulkJobStatus($jobId=null)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/ImageKit/Manage/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public static function purgeFileCache($urlParam, $resource)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -80,7 +81,8 @@ public static function purgeFileCacheStatus($requestId, GuzzleHttpWrapper $resou
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down
18 changes: 12 additions & 6 deletions src/ImageKit/Manage/CustomMetadataFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public static function get($fileId, $resource)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -82,7 +83,8 @@ public static function getFileMetadataFromRemoteURL($url, $resource)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -123,7 +125,8 @@ public static function createCustomMetadataField($name, $label, $schema, $resour
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -160,7 +163,8 @@ public static function getCustomMetadataField($includeDeleted, $resource)
return Response::respond(false, $content);
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -198,7 +202,8 @@ public static function updateCustomMetadataField($label, $schema, $resource)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -230,7 +235,8 @@ public static function deleteCustomMetadataField($resource)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}
}
45 changes: 30 additions & 15 deletions src/ImageKit/Manage/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public static function listFile(GuzzleHttpWrapper $resource,$parameters=null)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}


Expand Down Expand Up @@ -83,7 +84,8 @@ public static function getDetails($fileId, GuzzleHttpWrapper $resource)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -117,7 +119,8 @@ public static function getVersionDetails($fileId, $versionId, GuzzleHttpWrapper
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -151,7 +154,8 @@ public static function getFileVersions($fileId, GuzzleHttpWrapper $resource)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -188,7 +192,8 @@ public static function delete($fileId, GuzzleHttpWrapper $resource)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -225,7 +230,8 @@ public static function deleteVersion($fileId, $versionId, GuzzleHttpWrapper $res
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -261,7 +267,8 @@ public static function bulkDeleteByFileIds($fileIds, GuzzleHttpWrapper $resource
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -299,7 +306,8 @@ public static function copy($sourceFilePath, $destinationPath, $includeFileVersi
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -335,7 +343,8 @@ public static function move($sourceFilePath, $destinationPath, GuzzleHttpWrapper
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -373,7 +382,8 @@ public static function rename($filePath, $newFileName, $purgeCache, GuzzleHttpWr
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -407,7 +417,8 @@ public static function restoreVersion(GuzzleHttpWrapper $resource)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -445,7 +456,8 @@ public static function bulkAddTags($fileIds, $tags, GuzzleHttpWrapper $resource)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -487,7 +499,8 @@ public static function bulkRemoveTags(array $fileIds, array $tags, GuzzleHttpWra
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -524,7 +537,8 @@ public static function bulkRemoveAITags(array $fileIds, array $AITags, GuzzleHtt
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -571,7 +585,8 @@ public static function updateDetails($fileId, $updateData, GuzzleHttpWrapper $re
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}
}
12 changes: 8 additions & 4 deletions src/ImageKit/Manage/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public static function create($folderName, $parentFolderPath, GuzzleHttpWrapper
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -78,7 +79,8 @@ public static function delete($folderPath, GuzzleHttpWrapper $httpClient)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -113,7 +115,8 @@ public static function copy($sourceFolderPath, $destinationPath, $includeFileVer
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}

Expand Down Expand Up @@ -147,7 +150,8 @@ public static function move($sourceFolderPath, $destinationPath, GuzzleHttpWrapp
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}
}
}
3 changes: 2 additions & 1 deletion src/ImageKit/Upload/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public static function upload(array $uploadOptions, GuzzleHttpWrapper $resource)
return Response::respond(false, ($content));
}
else{
return Response::respond(true, ErrorMessages::$INVALID_REQUEST->message);
$errorObject = (object) ErrorMessages::$INVALID_REQUEST;
return Response::respond(true, $errorObject->message);
}


Expand Down

0 comments on commit b4b888a

Please sign in to comment.