/** * Add support for callable */ public function attr($key, $value = null) { if (is_callable($key)) { $this->attr_callback = $key; return $this; } else { return parent::attr($key, $value); } }