1 | <?php |
||
18 | class JailObject implements \ArrayAccess |
||
19 | { |
||
20 | /** |
||
21 | * @var string[] |
||
22 | */ |
||
23 | private $whiteListFunctions; |
||
24 | |||
25 | /** |
||
26 | * @var string[] |
||
27 | */ |
||
28 | private $jailedFunctions; |
||
29 | |||
30 | /** |
||
31 | * @var Jailable |
||
32 | */ |
||
33 | private $object; |
||
34 | |||
35 | /** |
||
36 | * JailObject constructor. |
||
37 | * |
||
38 | * @param Jailable $object The object that will be jailed |
||
39 | * @param array $whiteListFunctions A list of function names that can be called |
||
40 | * @param array $jailedFunctions |
||
41 | */ |
||
42 | 34 | public function __construct (&$object, array $whiteListFunctions, array $jailedFunctions = array()) |
|
53 | |||
54 | 4 | public function __call ($name, $arguments) |
|
76 | |||
77 | 18 | public function coreInstanceOf ($class) |
|
81 | |||
82 | // |
||
83 | // ArrayAccess Implementation |
||
84 | // |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 23 | public function offsetExists($offset) |
|
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | 31 | public function offsetGet($offset) |
|
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function offsetSet($offset, $value) |
||
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | public function offsetUnset($offset) |
||
117 | } |