Completed
Pull Request — 8.x-1.x (#117)
by
unknown
03:25
created

WidgetValidationBase   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 49
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A defaultConfiguration() 0 3 1
A label() 0 3 1
A validate() 0 1 1
A getConfiguration() 0 3 1
A setConfiguration() 0 3 1
A calculateDependencies() 0 3 1
1
<?php
2
3
/**
4
 * @file
5
 * Contains \Drupal\entity_browser\WidgetValidationBase.
6
 */
7
8
namespace Drupal\entity_browser;
9
10
use Drupal\Core\Plugin\PluginBase;
11
use Drupal\Core\TypedData\DataDefinitionInterface;
12
13
/**
14
 * Base implementation for widget validation plugins.
15
 */
16
abstract class WidgetValidationBase extends PluginBase implements WidgetValidationInterface {
17
18
  /**
19
   * Plugin label.
20
   *
21
   * @var string
22
   */
23
  protected $label;
24
25
  /**
26
   * {@inheritdoc}
27
   */
28
  public function defaultConfiguration() {
29
    return [];
30
  }
31
32
  /**
33
   * {@inheritdoc}
34
   */
35
  public function label() {
36
    $this->label;
37
  }
38
39
  /**
40
   * {@inheritdoc}
41
   */
42
  public function validate(array $entities, $options = []) {}
43
44
  /**
45
   * {@inheritdoc}
46
   */
47
  public function getConfiguration() {
48
    return $this->configuration;
49
  }
50
51
  /**
52
   * {@inheritdoc}
53
   */
54
  public function setConfiguration(array $configuration) {
55
    $this->configuration = $configuration;
56
  }
57
58
  /**
59
   * {@inheritdoc}
60
   */
61
  public function calculateDependencies() {
62
    return [];
63
  }
64
}
65