PluginProbe
Boxzilla – WordPress Popup Builder / trunk
Boxzilla – WordPress Popup Builder vtrunk
3.4.11 3.4.10 3.4.9 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 trunk 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 All 72 releases
boxzilla / src / di / class-container-with-property-access.php

class-container-with-property-access.php in Boxzilla – WordPress Popup Builder trunk, at src/di/class-container-with-property-access.php

59 lines 1017 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Boxzilla\DI;
4
5 /**
6 * Class ContainerWithPropertyAccess
7 *
8 * This modifies Pimple so it is PSR-11 compatible and can be accessed using property accessors.
9 *
10 * @package Boxzilla\DI
11 */
12 class ContainerWithPropertyAccess extends Container
13 {
14 /**
15 * @param string $name
16 * @return mixed
17 */
18 public function __get($name)
19 {
20 return $this->offsetGet($name);
21 }
22
23 /**
24 * @param string $name
25 * @param mixed $value
26 */
27 public function __set($name, $value)
28 {
29 $this[ $name ] = $value;
30 }
31
32 /**
33 * @param string $name
34 * @return bool
35 */
36 public function __isset($name)
37 {
38 return $this->offsetExists($name);
39 }
40
41 /**
42 * @param string $name
43 * @return bool
44 */
45 public function has($name)
46 {
47 return $this->offsetExists($name);
48 }
49
50 /**
51 * @param string $name
52 * @return mixed
53 */
54 public function get($name)
55 {
56 return $this->offsetGet($name);
57 }
58 }
59