public static function lambdaToSortFlagsAndOrder($closure, &$sortOrder)
    {
        if ($sortOrder !== SORT_ASC && $sortOrder !== SORT_DESC)
            $sortOrder = $sortOrder ? SORT_DESC : SORT_ASC;
        if (is_int($closure))
            return $closure;
        elseif (($closure === null || is_string($closure)) && isset(self::$compareFunctionToSortFlags[$closure]))
            return self::$compareFunctionToSortFlags[$closure];
        else
            return null;
    }
public static function lambdaToSortFlagsAndOrder($closure, &$sortOrder)
    {
        if ($sortOrder !== SORT_ASC && $sortOrder !== SORT_DESC)
            $sortOrder = $sortOrder ? SORT_DESC : SORT_ASC;
        if (is_int($closure))
            return $closure;
        elseif (($closure === null || is_string($closure)) && isset(self::$compareFunctionToSortFlags[$closure]))
            return self::$compareFunctionToSortFlags[$closure];
        else
            return null;
    }
public static function lambdaToSortFlagsAndOrder ( $ closure , & $ sortOrder ) { if ( $ sortOrder !== SORT_ASC && $ sortOrder !== SORT_DESC ) $ sortOrder = $ sortOrder ? SORT_DESC : SORT_ASC ; if ( is_int ( $ closure ) ) return $ closure ; elseif ( ( $ closure === null || is_string ( $ closure ) ) && isset ( self :: $ compareFunctionToSortFlags [ $ closure ] ) ) return self :: $ compareFunctionToSortFlags [ $ closure ] ; else return null ; }
Convert string lambda to SORT_ flags. Convert sortOrder from bool to SORT_ order.
@param callable|string|int|null $closure
@param int|bool $sortOrder
@return callable|string|int|null
Convert string lambda to SORT_ flags . Convert sortOrder from bool to SORT_ order .