static public function isValid($direction, $throw = false)
    {
        $valid = in_array($direction, [
            static::NONE,
            static::ASC,
            static::DESC,
        ], true);

        if (!$valid && $throw) {
            throw new InvalidArgumentException(sprintf("The direction '%s' is not valid.", $direction));
        }

        return $valid;
    }
static public function isValid($direction, $throw = false)
    {
        $valid = in_array($direction, [
            static::NONE,
            static::ASC,
            static::DESC,
        ], true);

        if (!$valid && $throw) {
            throw new InvalidArgumentException(sprintf("The direction '%s' is not valid.", $direction));
        }

        return $valid;
    }
static public function isValid ( $ direction , $ throw = false ) { $ valid = in_array ( $ direction , [ static :: NONE , static :: ASC , static :: DESC , ] , true ) ; if ( ! $ valid && $ throw ) { throw new InvalidArgumentException ( sprintf ( "The direction '%s' is not valid." , $ direction ) ) ; } return $ valid ; }
Returns whether the given direction is valid.

@param string $direction
@param bool $throw

@return bool
Returns whether the given direction is valid .