Completed
Push — 1.0.x ( 7e12c5...da53ed )
by Antonio
66:08 queued 64:19
created

EditableConfig::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace NuvoleWeb\Drupal\Driver\Objects\Drupal8;
4
5
use NuvoleWeb\Drupal\Driver\Objects\EditableConfigInterface;
6
7
/**
8
 * Class EditableConfig
9
 *
10
 * @package NuvoleWeb\Drupal\Driver\Objects\Drupal8
11
 */
12
class EditableConfig implements EditableConfigInterface {
13
14
  protected $config;
15
16
  /**
17
   * EditableConfig constructor.
18
   *
19
   * @param string $name
20
   *   The config name.
21
   */
22
  public function __construct($name) {
23
    $this->config = \Drupal::configFactory()->getEditable($name);
24
  }
25
26
  /**
27
   * {@inheritdoc}
28
   */
29
  public function get($key = '') {
30
    return $this->config->get($key);
31
  }
32
33
  /**
34
   * {@inheritdoc}
35
   */
36
  public function set($key, $value) {
37
    return $this->config->set($key, $value);
38
  }
39
40
  /**
41
   * {@inheritdoc}
42
   */
43
  public function setData(array $data) {
44
    return $this->config->setData($data);
45
  }
46
47
  /**
48
   * {@inheritdoc}
49
   */
50
  public function getData() {
51
    return $this->config->getRawData();
52
  }
53
54
  /**
55
   * {@inheritdoc}
56
   */
57
  public function save() {
58
    return $this->config->save();
59
  }
60
61
}
62