public function invokeFunction($function, array $args = array())
    {

        if (! $function || ! is_string($function) || '' === $function) {
            throw new InvalidArgumentException(_('Missing valid function to invoke.'));
        }

        try {
            $reflection        = new ReflectionFunction($function);
            $ordered_arguments = Helper::parseParams(
                $reflection->getParameters(),
                $args
            );

            return $reflection->invokeArgs($ordered_arguments);
        } catch (Exception $exception) {
            throw new InvalidArgumentException(
                sprintf(
                    _('Failed to invoke function "%1$s". Reason: %2$s'),
                    $function,
                    $exception->getMessage()
                )
            );
        }
    }