ImmutableConfig   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 14
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A onConstruct() 0 2 1
A subConfig() 0 2 1
A with() 0 4 1
1
<?php
2
3
namespace Logikos\Util\Config;
4
5
use Logikos\Util\Config;
6
7
class ImmutableConfig extends Config {
8
9 12
  protected function onConstruct() {
10 12
    $this->lock();
11 12
  }
12
13 1
  protected function subConfig($arrayConfig = []) {
14 1
    return new self($arrayConfig);
15
  }
16
17 2
  public function with($key, $value) {
18 2
    $values = $this->rawValues();
19 2
    $values[$key] = $value;
20 2
    return new self($values);
21
  }
22
}