Change record status: 
Introduced in branch: 

\Drupal\Core\Routing\PathBasedGeneratorInterface previously supplemented rather than inherited from the Symfony's UrlGeneratorInterface, so while it was being used as a type hint in places, it was actually not covering all the methods that might be called.

This change replaces it with \Drupal\Core\Routing\UrlGeneratorInterface, which should be used for type hinting in any Drupal code requiring Drupal-aware url-generation from routes or (deprecated) system paths.

In addition, the interface and class define generateFromRoute(), which takes an options array like url() does. This brings URL generation for routes to parity with system paths, and allows a developer to specify a language (e.g. for path prefixing), a #fragment, etc.

This method is available also as a shortcut on the Drupal object, Drupal::url(), which can be used e.g. in place of url() in procedural code when you need a path for a named route:

Drupal 7:

t('Visit the <a href="@url">content types</a> page', array('@url' => url('admin/structure/types')));

Drupal 8:

t('Visit the <a href="@url">content types</a> page', array('@url' => Drupal::url('node_overview_types')));

Note that calling Drupal::url() is the same as calling Drupal::urlGenerator()->generateFromRoute()

Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other updates done