alaouy / YouTube

🔥 Laravel PHP Facade/Wrapper for the Youtube Data API
MIT License
780 stars 205 forks source link

Casting for arrays in Youtube.php #156

Closed vtellez closed 2 years ago

vtellez commented 4 years ago

Hi,

I've recently updated to php 7.2.27 and I've found an error in src/Youtube.php

ErrorException: array_merge(): Argument #2 is not an array in /.../vendor/alaouy/youtube/src/Youtube.php:409

There are some lines with the same bug: 387, 409, 435,

I've fixed it changing this line:

$params = array_merge($params, $optionalParams);

To this one:

$params = array_merge((array)$params, (array)$optionalParams);

Please, considere to update main core code to include this fix

vtellez commented 4 years ago

any good news?

alaouy commented 4 years ago

@vtellez I've been away from the PHP scene lately, all PRs for fixes or new features are welcome.