Better parsing of urls (2)

better parsing of relative urls
fix the code with php-cs-fixer