Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
VisitorsNumeric
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 access
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace Drupal\visitors\Plugin\views\field;
4
5use Drupal\Core\Session\AccountInterface;
6use Drupal\views\Attribute\ViewsField;
7use Drupal\views\Plugin\views\field\NumericField;
8
9/**
10 * Field handler to display numeric values from the visitors module.
11 *
12 * @ingroup views_field_handlers
13 */
14#[ViewsField("visitors_numeric")]
15class VisitorsNumeric extends NumericField {
16
17  /**
18   * {@inheritdoc}
19   */
20  public function access(AccountInterface $account) {
21    return $account->hasPermission('view visitors counter');
22  }
23
24}