X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdevel%2Fwebprofiler%2Fsrc%2FState%2FStateWrapper.php;fp=web%2Fmodules%2Fcontrib%2Fdevel%2Fwebprofiler%2Fsrc%2FState%2FStateWrapper.php;h=f42e66f358894c9d3d4531acad741b0bd14cb029;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/devel/webprofiler/src/State/StateWrapper.php b/web/modules/contrib/devel/webprofiler/src/State/StateWrapper.php new file mode 100644 index 000000000..f42e66f35 --- /dev/null +++ b/web/modules/contrib/devel/webprofiler/src/State/StateWrapper.php @@ -0,0 +1,110 @@ +state = $state; + $this->dataCollector = $dataCollector; + } + + /** + * {@inheritdoc} + */ + public function get($key, $default = NULL) { + $this->dataCollector->addState($key); + + return $this->state->get($key, $default); + } + + /** + * {@inheritdoc} + */ + public function getMultiple(array $keys) { + foreach ($keys as $key) { + $this->dataCollector->addState($key); + } + + return $this->state->getMultiple($keys); + } + + /** + * {@inheritdoc} + */ + public function set($key, $value) { + $this->state->set($key, $value); + } + + /** + * {@inheritdoc} + */ + public function setMultiple(array $data) { + $this->state->setMultiple($data); + } + + /** + * {@inheritdoc} + */ + public function delete($key) { + $this->state->delete($key); + } + + /** + * {@inheritdoc} + */ + public function deleteMultiple(array $keys) { + $this->state->deleteMultiple($keys); + } + + /** + * {@inheritdoc} + */ + public function resetCache() { + $this->state->resetCache(); + } + + /** + * Passes through all non-tracked calls onto the decorated object. + * + * @param string $method + * The called method. + * @param mixed $args + * The passed in arguments. + * + * @return mixed + * The return argument of the call. + */ + public function __call($method, $args) { + return call_user_func_array([$this->state, $method], $args); + } + +}