public static function makeComplexSortFunction($sortFnArr, $index = 0)
    {
        if (isset($sortFnArr[$index])) {
            $fn1 = $sortFnArr[$index];
        } else {
            throw new InvalidArgumentException('First argument must be an array conatining at least one callable');
        }

        $fn2 = null;
        if (isset($sortFnArr[$index + 1])) {
            $fn2 = self::makeComplexSortFunction($sortFnArr, $index + 1);
        }

        return self::makeChainedSortFunction($fn1, $fn2);
    }