/**
  * {@inheritDoc}
  */
 public function handleDefunctRoutes(UriContextCollection $uriContextCollection)
 {
     $referringAutoRouteCollection = $this->adapter->getReferringAutoRoutes($uriContextCollection->getSubjectObject());
     foreach ($referringAutoRouteCollection as $referringAutoRoute) {
         if (false === $uriContextCollection->containsAutoRoute($referringAutoRoute)) {
             $newRoute = $uriContextCollection->getAutoRouteByTag($referringAutoRoute->getAutoRouteTag());
             $this->adapter->createRedirectRoute($referringAutoRoute, $newRoute);
         }
     }
 }
 /**
  * {@inheritdoc}
  */
 public function handleDefunctRoutes(UriContextCollection $uriContextCollection)
 {
     $referringAutoRouteCollection = $this->adapter->getReferringAutoRoutes($uriContextCollection->getSubjectObject());
     foreach ($referringAutoRouteCollection as $referringAutoRoute) {
         if (false === $uriContextCollection->containsAutoRoute($referringAutoRoute)) {
             $newRoute = $uriContextCollection->getAutoRouteByTag($referringAutoRoute->getAutoRouteTag());
             if (null !== $newRoute) {
                 $this->adapter->migrateAutoRouteChildren($referringAutoRoute, $newRoute);
             }
             $this->adapter->removeAutoRoute($referringAutoRoute);
         }
     }
 }