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

ContainerPlus::__call()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 3
rs 10
c 2
b 0
f 0
ccs 0
cts 2
cp 0
crap 2
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