diff options
author | Matt Friedman <maf675@gmail.com> | 2013-12-12 10:28:10 -0800 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2013-12-12 10:28:10 -0800 |
commit | a59bbeed2dd82b316f1e2f9ad484b978ef2a541c (patch) | |
tree | f3d667b7711b44fa56f6d575b8ae2bc072682d23 /phpBB/phpbb/event/data.php | |
parent | 2ae6f216f66466a1851f52cbc9839e3405525981 (diff) | |
parent | da6ced59d9632fec5103ce4bea86eb6bcceb5d1e (diff) | |
download | forums-a59bbeed2dd82b316f1e2f9ad484b978ef2a541c.tar forums-a59bbeed2dd82b316f1e2f9ad484b978ef2a541c.tar.gz forums-a59bbeed2dd82b316f1e2f9ad484b978ef2a541c.tar.bz2 forums-a59bbeed2dd82b316f1e2f9ad484b978ef2a541c.tar.xz forums-a59bbeed2dd82b316f1e2f9ad484b978ef2a541c.zip |
[ticket/11966] Merge branch 'develop' into ticket/11966
PHPBB3-11966
Diffstat (limited to 'phpBB/phpbb/event/data.php')
-rw-r--r-- | phpBB/phpbb/event/data.php | 100 |
1 files changed, 46 insertions, 54 deletions
diff --git a/phpBB/phpbb/event/data.php b/phpBB/phpbb/event/data.php index 3481023b74..fbb16574ed 100644 --- a/phpBB/phpbb/event/data.php +++ b/phpBB/phpbb/event/data.php @@ -9,62 +9,54 @@ namespace phpbb\event; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\EventDispatcher\Event; class data extends Event implements \ArrayAccess { - private $data; - - public function __construct(array $data = array()) - { - $this->set_data($data); - } - - public function set_data(array $data = array()) - { - $this->data = $data; - } - - public function get_data() - { - return $this->data; - } - - /** - * Returns data filtered to only include specified keys. - * - * This effectively discards any keys added to data by hooks. - */ - public function get_data_filtered($keys) - { - return array_intersect_key($this->data, array_flip($keys)); - } - - public function offsetExists($offset) - { - return isset($this->data[$offset]); - } - - public function offsetGet($offset) - { - return isset($this->data[$offset]) ? $this->data[$offset] : null; - } - - public function offsetSet($offset, $value) - { - $this->data[$offset] = $value; - } - - public function offsetUnset($offset) - { - unset($this->data[$offset]); - } + private $data; + + public function __construct(array $data = array()) + { + $this->set_data($data); + } + + public function set_data(array $data = array()) + { + $this->data = $data; + } + + public function get_data() + { + return $this->data; + } + + /** + * Returns data filtered to only include specified keys. + * + * This effectively discards any keys added to data by hooks. + */ + public function get_data_filtered($keys) + { + return array_intersect_key($this->data, array_flip($keys)); + } + + public function offsetExists($offset) + { + return isset($this->data[$offset]); + } + + public function offsetGet($offset) + { + return isset($this->data[$offset]) ? $this->data[$offset] : null; + } + + public function offsetSet($offset, $value) + { + $this->data[$offset] = $value; + } + + public function offsetUnset($offset) + { + unset($this->data[$offset]); + } } |