diff -u b/core/modules/statistics/src/NodeStatisticsDatabaseStorage.php b/core/modules/statistics/src/NodeStatisticsDatabaseStorage.php --- b/core/modules/statistics/src/NodeStatisticsDatabaseStorage.php +++ b/core/modules/statistics/src/NodeStatisticsDatabaseStorage.php @@ -2,10 +2,7 @@ namespace Drupal\statistics; -use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityTypeInterface; -use Drupal\Core\State\StateInterface; -use Symfony\Component\HttpFoundation\RequestStack; /** * Provides the default database storage backend for statistics. diff -u b/core/modules/statistics/src/StatisticsDatabaseStorage.php b/core/modules/statistics/src/StatisticsDatabaseStorage.php --- b/core/modules/statistics/src/StatisticsDatabaseStorage.php +++ b/core/modules/statistics/src/StatisticsDatabaseStorage.php @@ -221,7 +221,7 @@ * * @throws \Exception */ - protected function catchException(EntityTypeInterface $entity_type,\Exception $e) { + protected function catchException(EntityTypeInterface $entity_type, \Exception $e) { if ($this->connection->schema()->tableExists($this->tableName($entity_type))) { throw $e; } diff -u b/core/modules/statistics/statistics.install b/core/modules/statistics/statistics.install --- b/core/modules/statistics/statistics.install +++ b/core/modules/statistics/statistics.install @@ -28,7 +28,6 @@ return 8300; } - /** * Replace count_content_views settings with entity_type_ids setting. */ @@ -39,4 +38,4 @@ $config->clear('count_content_views') // Set the new configuration setting for entity_type_ids to the initial value. ->set('entity_type_ids', $value)->save(); -} \ No newline at end of file +} diff -u b/core/modules/statistics/statistics.services.yml b/core/modules/statistics/statistics.services.yml --- b/core/modules/statistics/statistics.services.yml +++ b/core/modules/statistics/statistics.services.yml @@ -5,6 +5,12 @@ tags: - { name: backend_overridable } + statistics.storage.node: + class: Drupal\statistics\NodeStatisticsDatabaseStorage + arguments: ['@database', '@request_stack'] + tags: + - { name: backend_overridable } + statistics.reset_count: class: Drupal\statistics\StatisticsResetCount arguments: ['@database', '@state', '@datetime.time']