src/Core/Routing/CurrentRouteMatchTrait.php
public function getCurrentRouteMatch() {
    if (empty($this->currentRouteMatch)) {
      $this->currentRouteMatch = \Drupal::service('current_route_match');
    }
    return $this->currentRouteMatch;
  }
public function getCurrentRouteMatch() {
    if (empty($this->currentRouteMatch)) {
      $this->currentRouteMatch = \Drupal::service('current_route_match');
    }
    return $this->currentRouteMatch;
  }
public function getCurrentRouteMatch ( ) { if ( empty ( $ this -> currentRouteMatch ) ) { $ this -> currentRouteMatch = \ Drupal :: service ( 'current_route_match' ) ; } return $ this -> currentRouteMatch ; }
Gets the current route match.

@return \Drupal\Core\Routing\ResettableStackedRouteMatchInterface
The alias manager.
Gets the current route match .