src/Utility/Validator.php
protected static function validateSortByOrder(string $data): string
    {
        $options = array_keys(Options::getSortByOrders());
        if (!in_array($data, $options)) {
            $data = Options::DEFAULT_SORT_BY_ORDER;
        }

        return $data;
    }
protected static function validateSortByOrder(string $data): string
    {
        $options = array_keys(Options::getSortByOrders());
        if (!in_array($data, $options)) {
            $data = Options::DEFAULT_SORT_BY_ORDER;
        }

        return $data;
    }
protected static function validateSortByOrder ( string $ data ) : string { $ options = array_keys ( Options :: getSortByOrders ( ) ) ; if ( ! in_array ( $ data , $ options ) ) { $ data = Options :: DEFAULT_SORT_BY_ORDER ; } return $ data ; }
Validate search sort by order.

@param string $data Sort by order value
@return string
Validate search sort by order .