composer require mrprompt/silex-youtube
use SilexFriends\YouTube\YouTube;
...
$api_key = getenv('YOUTUBE_API_KEY');
$app = new Application;
$app->register(new YouTube($api_key));
...
/* @var $video array */
$video = $app['youtube']('http://...');
var_dump($video);
./vendor/bin/phpunit
MIT