Update UrlGenerator.php

Fixed toRoute function