protected function getDirection($direction): int
    {
        if (\is_string($direction)) {
            $direction = \strtolower($direction);

            if ($direction === 'desc') {
                $direction = \SORT_DESC;
            } else {
                $direction = \SORT_ASC;
            }
        }

        if (
            $direction !== \SORT_DESC
            &&
            $direction !== \SORT_ASC
        ) {
            $direction = \SORT_ASC;
        }

        return $direction;
    }
protected function getDirection($direction): int
    {
        if (\is_string($direction)) {
            $direction = \strtolower($direction);

            if ($direction === 'desc') {
                $direction = \SORT_DESC;
            } else {
                $direction = \SORT_ASC;
            }
        }

        if (
            $direction !== \SORT_DESC
            &&
            $direction !== \SORT_ASC
        ) {
            $direction = \SORT_ASC;
        }

        return $direction;
    }
protected function getDirection ( $ direction ) : int { if ( \ is_string ( $ direction ) ) { $ direction = \ strtolower ( $ direction ) ; if ( $ direction === 'desc' ) { $ direction = \ SORT_DESC ; } else { $ direction = \ SORT_ASC ; } } if ( $ direction !== \ SORT_DESC && $ direction !== \ SORT_ASC ) { $ direction = \ SORT_ASC ; } return $ direction ; }
Get correct PHP constant for direction.

@param int|string $direction

@return int
Get correct PHP constant for direction .