Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed php notice ( Array to string conversion ) in src/Osms.php #8

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Osms.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ class Osms
* token yet, he can leave $token empty and retrieve a token with
* getTokenFromConsumerKey() method later.
*
* @param array $config An associative array that can contain clientId, clientSecret,
* token, and verifyPeerSSL
* @param array $config An associative array containing clientId (required),
* clientSecret (required), token (optional),
* and verifyPeerSSL (optional)
*
* @return void
*/
Expand Down Expand Up @@ -276,7 +277,6 @@ public function callApi(

if ($httpCode !== $successCode) {
$errorMessage = '';

if (!empty($response['error_description'])) {
$errorMessage = $response['error_description'];
} elseif (!empty($response['error'])) {
Expand All @@ -287,10 +287,10 @@ public function callApi(
$errorMessage = $response['message'];
} elseif (!empty($response['requestError']['serviceException'])) {
$errorMessage = $response['requestError']['serviceException']['text']
. ' ' . $response['requestError']['serviceException']['variables'];
. ' ' . implode(" --- ",$response['requestError']['serviceException']['variables']);
} elseif (!empty($response['requestError']['policyException'])) {
$errorMessage = $response['requestError']['policyException']['text']
. ' ' . $response['requestError']['policyException']['variables'];
. ' ' . implode(" --- ",$response['requestError']['policyException']['variables']);
}

return array('error' => $errorMessage);
Expand Down