We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Warning: Undefined property: stdClass::$items in
/vendor/alaouy/youtube/src/Youtube.php on line 644
Now
public function decodeSingle(&$apiData) { $resObj = json_decode($apiData); if (isset($resObj->error)) { $msg = "Error " . $resObj->error->code . " " . $resObj->error->message; if (isset($resObj->error->errors[0])) { $msg .= " : " . $resObj->error->errors[0]->reason; } throw new \Exception($msg); } else { $itemsArray = $resObj->items; if (!is_array($itemsArray) || count($itemsArray) == 0) { return false; } else { return $itemsArray[0]; } } }
Need
public function decodeSingle(&$apiData) { $resObj = json_decode($apiData); if (isset($resObj->error)) { $msg = "Error " . $resObj->error->code . " " . $resObj->error->message; if (isset($resObj->error->errors[0])) { $msg .= " : " . $resObj->error->errors[0]->reason; } throw new \Exception($msg); } else { $itemsArray = isset($resObj->items) ? $resObj->items : null; if ( ! is_array($itemsArray) || count($itemsArray) == 0) { return false; } else { return isset($itemsArray[0]) ? $itemsArray[0] : false; } } }
The text was updated successfully, but these errors were encountered:
@shabuninil Pull requests with tests are always welcome ;)
Sorry, something went wrong.
Is this a change in the API, should I downgrade or something until a fix is in place?
Fix items issue based on alaouy#189
c422658
No branches or pull requests
Warning: Undefined property: stdClass::$items in
/vendor/alaouy/youtube/src/Youtube.php on line 644
Now
Need
The text was updated successfully, but these errors were encountered: