src/Fluent.php
public function on($function, $callback = null)
    {
        if (is_string($function)) {
            if ($callback) {
                $closure = (new \ReflectionFunction($callback))->getClosure();
                return $this->{$function}($closure->bindTo($this));
            } else {
                return $this->{$function}($this->use);
            }
        }

        $clone       = clone $this;
        $clone->data = $function($this->data, $this->use);

        return $clone;
    }
public function on($function, $callback = null)
    {
        if (is_string($function)) {
            if ($callback) {
                $closure = (new \ReflectionFunction($callback))->getClosure();
                return $this->{$function}($closure->bindTo($this));
            } else {
                return $this->{$function}($this->use);
            }
        }

        $clone       = clone $this;
        $clone->data = $function($this->data, $this->use);

        return $clone;
    }
@param mixed $function
@param mixed $callback

@return Fluent
@throws \ReflectionException