Getting twitch username PHP and oAuth

Following the readme for that php class. https://github.com/Xxplosions/twitchtv-oauth
It would be like this.
You have a page that uses the class and you do

< a href="<?php echo $twitchtv->authenticate() ?>">Authenticate Me</ a>

on your return uri page use the class again and do this.

<?php $ttv_code = $_GET['code']; $access_token = $twitchtv->get_access_token($ttv_code); $user_name = $twitchtv->authenticated_user($access_token); echo 'thank you ',$user_name,'for authenticating me!'; ?>