Completed
Push — work-fleets ( 867546...331178 )
by SuperNova.WS
06:17
created

ContainerMagic   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 35
ccs 15
cts 15
cp 1
rs 10
wmc 7
lcom 1
cbo 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A isEmpty() 0 3 1
A __set() 0 3 1
A __get() 0 3 2
A __isset() 0 3 1
A __unset() 0 3 1
A clear() 0 3 1
1
<?php
2
3
/**
4
 * Created by Gorlum 30.07.2016 9:54
5
 */
6
7
namespace Common;
8
9
class ContainerMagic implements IMagicAccess {
10
11
  /**
12
   * Property values
13
   *
14
   * @var array
15
   */
16
  protected $values = array();
17
18 1
  public function isEmpty() {
19 1
    return empty($this->values);
20
  }
21
22 1
  public function __set($name, $value) {
23 1
    $this->values[$name] = $value;
24 1
  }
25
26 1
  public function __get($name) {
27 1
    return isset($this->values[$name]) ? $this->values[$name] : null;
28
  }
29
30 1
  public function __isset($name) {
31 1
    return isset($this->values[$name]);
32
  }
33
34 1
  public function __unset($name) {
35 1
    unset($this->values[$name]);
36 1
  }
37
38
39 1
  public function clear() {
40 1
    $this->values = array();
41 1
  }
42
43
}
44