Fatal error: Call to a member function getRefreshToken() on string

I am trying to integrate the php sdk but I am getting the below error when trying to refresh token. Please help

Fatal error : Call to a member function getRefreshToken() on string in /home/spmglms/public_html/Lead/vendor/infusionsoft/php-sdk/src/Infusionsoft/Infusionsoft.php on line 312

PHP isn’t my one of my primary languages, but glancing at the SDK code, it appears that if you don’t have tokens set when you try to call that, that line will error out.