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); } }