3 namespace Drupal\drupalmoduleupgrader\Routing;
5 use Drupal\drupalmoduleupgrader\Routing\Drupal7\RouteWrapper;
6 use Drupal\drupalmoduleupgrader\TargetInterface;
9 * Defines a route converter, which converts a Drupal 7 router item to a
10 * Drupal 8 Symfony route. These plugins are NOT responsible for converting
11 * *links* (including tabs or local actions), only the actual route.
13 * Every method in this interface takes two arguments. First, a TargetInterface
14 * representing the target module. Second, the original Drupal 7 route (i.e.,
15 * hook_menu() item), wrapped in a RouteWrapperInterface.
17 interface RouteConverterInterface {
20 * Generates the route's machine-readable name.
24 public function getName(TargetInterface $target, RouteWrapper $route);
27 * Builds the Drupal 8 path for the route.
29 * The path should be prefixed by a slash, and contain {slugs} corresponding
30 * to parameters of the callback method which can accept input from the path.
31 * Parameters are matched to slugs by name and type hint.
33 * @return \Drupal\drupalmoduleupgrader\Utility\Path\PathUtilityInterface
35 public function buildPath(TargetInterface $target, RouteWrapper $route);
38 * Builds the Drupal 8 definition for the route, without making any changes
39 * to the original module or callback.
41 * @return Drupal8\RouteWrapper
43 public function buildRouteDefinition(TargetInterface $target, RouteWrapper $route);
46 * Builds the Drupal 8 route, making any needed changes to the original module
49 public function buildRoute(TargetInterface $target, RouteWrapper $route);