diff --git a/core/lib/Drupal/Core/Url.php b/core/lib/Drupal/Core/Url.php index 5e8dd44..9f78645 100644 --- a/core/lib/Drupal/Core/Url.php +++ b/core/lib/Drupal/Core/Url.php @@ -462,20 +462,10 @@ public function toString() { * usecases should get the information from the URL object manually. */ public function toArray() { - if ($this->unrouted) { - return array( - // @todo Change 'path' to 'href': https://www.drupal.org/node/2347025. - 'path' => $this->getUri(), - 'options' => $this->getOptions(), - ); - } - else { - return array( - 'route_name' => $this->getRouteName(), - 'route_parameters' => $this->getRouteParameters(), - 'options' => $this->getOptions(), - ); - } + return [ + 'url' => $this, + 'options' => $this->getOptions(), + ]; } /**