public function __construct($type, Closure $callback = null, $index = null) { $this->type = $type; if (!is_null($callback)) { $callback($this); } $this->index = $index; }