Completed
Pull Request — master (#157)
by
unknown
01:57
created

DriverFieldPluginManager   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 47
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFilterableTarget() 0 8 1
1
<?php
2
3
namespace Drupal\Driver\Plugin;
4
5
/**
6
 * Provides the plugin manager for the Driver's field plugins.
7
 */
8
class DriverFieldPluginManager extends DriverPluginManagerBase {
9
10
  /**
11
   * {@inheritdoc}
12
   */
13
  protected $driverPluginType = 'DriverField';
14
15
  /**
16
   * {@inheritdoc}
17
   */
18
  protected $filters = [
19
    'fieldNames',
20
    'fieldTypes',
21
    'entityBundles',
22
    'entityTypes',
23
  ];
24
25
  /**
26
   * {@inheritdoc}
27
   */
28
  protected $specificityCriteria = [
29
    ['fieldNames', 'entityBundles', 'entityTypes'],
30
    ['fieldNames', 'entityBundles'],
31
    ['fieldNames', 'entityTypes'],
32
    ['fieldNames', 'fieldTypes'],
33
    ['fieldNames'],
34
    ['fieldTypes', 'entityBundles'],
35
    ['fieldTypes', 'entityTypes'],
36
    ['fieldTypes'],
37
    ['entityBundles', 'entityTypes'],
38
    ['entityBundles'],
39
    ['entityTypes'],
40
  ];
41
42
  /**
43
   * {@inheritdoc}
44
   */
45
  protected function getFilterableTarget($field) {
46
    return [
47
      'fieldNames' => $field->getName(),
48
      'fieldTypes' => $field->getType(),
49
      'entityTypes' => $field->getEntityType(),
50
      'entityBundles' => $field->getBundle(),
51
    ];
52
  }
53
54
}
55