Skip to content
Snippets Groups Projects

Issue #3437136 by fgm: fix PHPCS issues.

2 unresolved threads
Files
22
@@ -8,17 +8,19 @@ use Drupal\Core\Block\BlockBase;
use Drupal\Core\Entity\EntityRepositoryInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Render\RendererInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\statistics\StatisticsStorageInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
// cspell:ignore daycount totalcount
/**
* Provides a 'Popular content' block.
*
* @phpstan-consistent-constructor
*/
#[Block(
id: "statistics_popular_block",
@@ -48,6 +50,8 @@ class StatisticsPopularBlock extends BlockBase implements ContainerFactoryPlugin
protected $statisticsStorage;
/**
* The renderer service.
*
* @var \Drupal\Core\Render\RendererInterface
*/
protected $renderer;
@@ -64,7 +68,7 @@ class StatisticsPopularBlock extends BlockBase implements ContainerFactoryPlugin
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
* @param \Drupal\Core\Entity\EntityRepositoryInterface $entity_repository
* The entity repository service
* The entity repository service.
* @param \Drupal\statistics\StatisticsStorageInterface $statistics_storage
* The storage for statistics.
* @param \Drupal\Core\Render\RendererInterface $renderer
@@ -104,13 +108,6 @@ class StatisticsPopularBlock extends BlockBase implements ContainerFactoryPlugin
];
}
/**
* {@inheritdoc}
*/
protected function blockAccess(AccountInterface $account) {
return AccessResult::allowedIfHasPermission($account, 'access content');
}
/**
* {@inheritdoc}
*/
@@ -209,9 +206,17 @@ class StatisticsPopularBlock extends BlockBase implements ContainerFactoryPlugin
'#items' => $items,
'#title' => $title,
'#cache' => [
'tags' => $this->entityTypeManager->getDefinition('node')->getListCacheTags(),
'tags' => $this->entityTypeManager->getDefinition('node')
->getListCacheTags(),
],
];
}
/**
* {@inheritdoc}
*/
protected function blockAccess(AccountInterface $account) {
return AccessResult::allowedIfHasPermission($account, 'access content');
Please register or sign in to reply
}
}
Loading