Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Normal
It doesn't make sense to set $validOembed if there is no title.The current code as outlined above doesn't make much sense to me at all as there never will be an exception that could be catched.By using GuzzleHttp\json_decode instead of just json_decode an exception would be thrown if there is a decode error so the existing exception handling code can kick in (in which case $validOembed would stay false).Using is_array($json) would work but still have the unused try-catch block .
It doesn't make sense to set $validOembed if there is no title.
$validOembed
The current code as outlined above doesn't make much sense to me at all as there never will be an exception that could be catched.
By using GuzzleHttp\json_decode instead of just json_decode an exception would be thrown if there is a decode error so the existing exception handling code can kick in (in which case $validOembed would stay false).
GuzzleHttp\json_decode
json_decode
false
Using is_array($json) would work but still have the unused try-catch block .
is_array($json)
We use essential cookies to make this site work, and optional cookies to enhance your experience.
See further information and configure your preferences