diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-11-27 14:55:05 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-11-27 14:55:24 +0100 |
commit | 33f4d267ef9a3b65a1fbda82afa13ecc486b5c80 (patch) | |
tree | 2e19c6d0b72144d50197c01dcc2ad000913553ef /phpBB/phpbb/event/data.php | |
parent | 0d4bf3ff45a76dcb763c76502944aa7bf78b690b (diff) | |
parent | 125e76f9aa83141534387a965e8373c9b9cd5c4d (diff) | |
download | forums-33f4d267ef9a3b65a1fbda82afa13ecc486b5c80.tar forums-33f4d267ef9a3b65a1fbda82afa13ecc486b5c80.tar.gz forums-33f4d267ef9a3b65a1fbda82afa13ecc486b5c80.tar.bz2 forums-33f4d267ef9a3b65a1fbda82afa13ecc486b5c80.tar.xz forums-33f4d267ef9a3b65a1fbda82afa13ecc486b5c80.zip |
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into ticket/11842
Conflicts:
phpBB/includes/acp/acp_groups.php
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]); + } } |