GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — 8.x-4.x-404 ( bbf086...a89268 )
by
unknown
05:03
created

ScenariosUIBlock   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A blockAccess() 0 5 2
A build() 0 3 1
1
<?php
2
3
namespace Drupal\dfs_default\Plugin\Block;
4
5
use Drupal\Core\Block\BlockBase;
6
use Drupal\Core\Access\AccessResult;
7
8
/**
9
 * Provides a 'ScenariosUIBlock' block.
10
 *
11
 * @Block(
12
 *  id = "scenarios_uiblock",
13
 *  admin_label = @Translation("Scenarios UI Block"),
14
 *  category = @Translation("Scenarios")
15
 * )
16
 */
17
class ScenariosUIBlock extends BlockBase {
18
19
  /**
20
   * {@inheritdoc}
21
   */
22
  public function blockAccess($account) {
23
    if ($account->hasPermission('administer scenarios')) {
24
      return AccessResult::allowed();
25
    }
26
    return AccessResult::forbidden();
27
  }
28
29
  /**
30
   * {@inheritdoc}
31
   */
32
  public function build() {
33
    $form = \Drupal::formBuilder()->getForm('Drupal\scenarios_ui\Form\ScenariosUIForm');
34
    return $form;
35
  }
36
37
}
38