diff --git a/core/modules/statistics/src/StatisticsDatabaseStorage.php b/core/modules/statistics/src/StatisticsDatabaseStorage.php index db4b720..76f988b 100644 --- a/core/modules/statistics/src/StatisticsDatabaseStorage.php +++ b/core/modules/statistics/src/StatisticsDatabaseStorage.php @@ -41,7 +41,7 @@ public function __construct(Connection $connection, RequestStack $request_stack) /** * {@inheritdoc} */ - public function recordView($entity_type_id, $key , $id) { + public function recordView($entity_type_id, $key, $id) { $table = $entity_type_id . '_counter'; try { return (bool) $this->connection @@ -56,7 +56,7 @@ public function recordView($entity_type_id, $key , $id) { ->expression('totalcount', 'totalcount + 1') ->execute(); } - catch(\Exception $e) { + catch (\Exception $e) { $database_schema = $this->connection->schema(); if ($database_schema->tableExists($table)) { throw $e; diff --git a/core/modules/statistics/src/StatisticsResetCount.php b/core/modules/statistics/src/StatisticsResetCount.php index d678939..e87d7f1 100644 --- a/core/modules/statistics/src/StatisticsResetCount.php +++ b/core/modules/statistics/src/StatisticsResetCount.php @@ -3,7 +3,6 @@ namespace Drupal\statistics; use Drupal\Component\Datetime\TimeInterface; -use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Database\Connection; use Drupal\Core\State\StateInterface; diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index 0a4f350..70e24b3 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -260,6 +260,9 @@ function statistics_block_alter(&$definitions) { } } +/** + * Callback for migration settings. + */ function statistics_migrate_callback($source) { return $source ? ['node'] : []; } diff --git a/core/modules/statistics/statistics.php b/core/modules/statistics/statistics.php index ffacd20..8090e02 100644 --- a/core/modules/statistics/statistics.php +++ b/core/modules/statistics/statistics.php @@ -25,7 +25,7 @@ $entity_type = filter_input(INPUT_POST, 'type', FILTER_CALLBACK, ['options' => 'statistics_validate_machine_name']); if ($key && $id && $entity_type && in_array($entity_type, $entity_types, TRUE)) { $container->get('request_stack')->push($request); - $container->get('statistics.storage')->recordView($entity_type, $key ,$id); + $container->get('statistics.storage')->recordView($entity_type, $key, $id); } /**