protected function checkAndReturnCallable($callback)
    {
        if (is_string($callback)) {
            return function ($app) use ($callback) {
                return $app($callback);
            };
        }

        if (!is_callable($callback)) {
            $type = is_object($callback) ? get_class($callback) : gettype($callback);
            throw new InvalidArgumentException("Passed argument of type $type is not callable");
        }

        return $callback;
    }
protected function checkAndReturnCallable($callback)
    {
        if (is_string($callback)) {
            return function ($app) use ($callback) {
                return $app($callback);
            };
        }

        if (!is_callable($callback)) {
            $type = is_object($callback) ? get_class($callback) : gettype($callback);
            throw new InvalidArgumentException("Passed argument of type $type is not callable");
        }

        return $callback;
    }
protected function checkAndReturnCallable ( $ callback ) { if ( is_string ( $ callback ) ) { return function ( $ app ) use ( $ callback ) { return $ app ( $ callback ) ; } ; } if ( ! is_callable ( $ callback ) ) { $ type = is_object ( $ callback ) ? get_class ( $ callback ) : gettype ( $ callback ) ; throw new InvalidArgumentException ( "Passed argument of type $type is not callable" ) ; } return $ callback ; }
Throws an exception if the arg is not callable.

@param callable $callback

@throws InvalidArgumentException

@return callable
Throws an exception if the arg is not callable .