private function run($callback)
    {
        $injects = [];
        $reflectionFunction = new \ReflectionFunction($callback);
        foreach ($reflectionFunction->getParameters() as $parameter) {
            if ($class = $parameter->getClass()) {
                $injects[] = app($class->name);
            }
        }

        return call_user_func_array($callback, $injects);
    }
private function run($callback)
    {
        $injects = [];
        $reflectionFunction = new \ReflectionFunction($callback);
        foreach ($reflectionFunction->getParameters() as $parameter) {
            if ($class = $parameter->getClass()) {
                $injects[] = app($class->name);
            }
        }

        return call_user_func_array($callback, $injects);
    }
private function run ( $ callback ) { $ injects = [ ] ; $ reflectionFunction = new \ ReflectionFunction ( $ callback ) ; foreach ( $ reflectionFunction -> getParameters ( ) as $ parameter ) { if ( $ class = $ parameter -> getClass ( ) ) { $ injects [ ] = app ( $ class -> name ) ; } } return call_user_func_array ( $ callback , $ injects ) ; }
This is a dependancy injection function which allows the config
function to have new classes without needing them to have a need
for actually newing up the new objects.

@param Callback $callback

@return Closure
This is a dependancy injection function which allows the config function to have new classes without needing them to have a need for actually newing up the new objects .