name = $name; $this->data = $data; } /** * Sets the data * * @param array $data */ public function setData(array $data) { $this->data = $data; } /** * @return array */ public function collect() { $data = array(); foreach ($this->data as $k => $v) { if (!is_string($v)) { $v = $this->getDataFormatter()->formatVar($v); } $data[$k] = $v; } return $data; } /** * @return string */ public function getName() { return $this->name; } /** * @return array */ public function getWidgets() { $name = $this->getName(); return array( "$name" => array( "icon" => "gear", "widget" => "PhpDebugBar.Widgets.VariableListWidget", "map" => "$name", "default" => "{}" ) ); } }