Loading l10n_community/src/Plugin/Block/ProjectStatisticsBlock.php +9 −3 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Drupal\Core\Block\BlockBase; use Drupal\Core\Cache\Cache; use Drupal\Core\Link; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Routing\CurrentRouteMatch; use Drupal\Core\Url; use Drupal\l10n_community\L10nStatistics; use Drupal\l10n_server\Entity\L10nServerRelease; Loading Loading @@ -43,12 +44,15 @@ class ProjectStatisticsBlock extends BlockBase implements ContainerFactoryPlugin * The plugin implementation definition. * @param \Drupal\l10n_community\L10nStatistics $statistics * The l10n_community.statistics service. * @param \Drupal\Core\Routing\CurrentRouteMatch $route_match * The current_route_match service. */ public function __construct( array $configuration, $plugin_id, $plugin_definition, L10nStatistics $statistics L10nStatistics $statistics, CurrentRouteMatch $route_match ) { parent::__construct( $configuration, Loading @@ -56,6 +60,7 @@ class ProjectStatisticsBlock extends BlockBase implements ContainerFactoryPlugin $plugin_definition ); $this->statistics = $statistics; $this->routeMatch = $route_match; } /** Loading @@ -71,7 +76,8 @@ class ProjectStatisticsBlock extends BlockBase implements ContainerFactoryPlugin $configuration, $plugin_id, $plugin_definition, $container->get('l10n_community.statistics') $container->get('l10n_community.statistics'), $container->get('current_route_match') ); } Loading @@ -80,7 +86,7 @@ class ProjectStatisticsBlock extends BlockBase implements ContainerFactoryPlugin */ public function build() { /** @var \Drupal\l10n_server\Entity\L10nServerProjectInterface $project */ if (!$project = \Drupal::routeMatch()->getParameter('l10n_server_project')) { if (!$project = $this->routeMatch->getParameter('l10n_server_project')) { return []; } Loading Loading
l10n_community/src/Plugin/Block/ProjectStatisticsBlock.php +9 −3 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Drupal\Core\Block\BlockBase; use Drupal\Core\Cache\Cache; use Drupal\Core\Link; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Routing\CurrentRouteMatch; use Drupal\Core\Url; use Drupal\l10n_community\L10nStatistics; use Drupal\l10n_server\Entity\L10nServerRelease; Loading Loading @@ -43,12 +44,15 @@ class ProjectStatisticsBlock extends BlockBase implements ContainerFactoryPlugin * The plugin implementation definition. * @param \Drupal\l10n_community\L10nStatistics $statistics * The l10n_community.statistics service. * @param \Drupal\Core\Routing\CurrentRouteMatch $route_match * The current_route_match service. */ public function __construct( array $configuration, $plugin_id, $plugin_definition, L10nStatistics $statistics L10nStatistics $statistics, CurrentRouteMatch $route_match ) { parent::__construct( $configuration, Loading @@ -56,6 +60,7 @@ class ProjectStatisticsBlock extends BlockBase implements ContainerFactoryPlugin $plugin_definition ); $this->statistics = $statistics; $this->routeMatch = $route_match; } /** Loading @@ -71,7 +76,8 @@ class ProjectStatisticsBlock extends BlockBase implements ContainerFactoryPlugin $configuration, $plugin_id, $plugin_definition, $container->get('l10n_community.statistics') $container->get('l10n_community.statistics'), $container->get('current_route_match') ); } Loading @@ -80,7 +86,7 @@ class ProjectStatisticsBlock extends BlockBase implements ContainerFactoryPlugin */ public function build() { /** @var \Drupal\l10n_server\Entity\L10nServerProjectInterface $project */ if (!$project = \Drupal::routeMatch()->getParameter('l10n_server_project')) { if (!$project = $this->routeMatch->getParameter('l10n_server_project')) { return []; } Loading