The old JFactory::getUri() function is no longer used. You should now use Uri::getInstance() followed by whatever you would have done such as ->toString() etc.