Completed
Push — work-fleets ( 4ec5b3...fe2ede )
by SuperNova.WS
10:06
created

ContainerPlus   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
dl 0
loc 41
rs 10
c 3
b 0
f 0
ccs 0
cts 16
cp 0
wmc 7
lcom 0
cbo 1

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __set() 0 3 1
A __get() 0 3 1
A __isset() 0 3 1
A __unset() 0 3 1
A __call() 0 3 1
A isEmpty() 0 3 1
A clear() 0 3 1
1
<?php
2
3
namespace Common;
4
use Pimple\Container;
5
6
/**
7
 * Class ContainerPlus
8
 *
9
 * Extends original container to allow access to properties and function to document them
10
 *
11
 * @package Pimple
12
 */
13
class ContainerPlus extends Container {
14
15
  public function __set($name, $value) {
16
    $this->offsetSet($name, $value);
17
  }
18
19
  public function __get($name) {
20
    return $this->offsetGet($name);
21
  }
22
23
  public function __isset($name) {
24
    return $this->offsetExists($name);
25
  }
26
27
  public function __unset($name) {
28
    $this->offsetUnset($name);
29
  }
30
31
  public function __call($name, $arguments) {
32
    return call_user_func_array($this->$name, $arguments);
33
  }
34
35
  /**
36
   * Is container contains no data
37
   *
38
   * @return bool
39
   */
40
  public function isEmpty() {
41
    throw new \Exception(get_class() . '::isEmpty() not implemented - inherited from ContainerPlus');
42
  }
43
44
  /**
45
   * Clears container contents
46
   *
47
   * @return mixed
48
   */
49
  public function clear() {
50
    throw new \Exception(get_class() . '::clear() not implemented - inherited from ContainerPlus');
51
  }
52
53
}
54