Reply to thread

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 .


Back
Top Bottom