Set direction

@param string $direction MirrorAction::MIRROR_VERTICAL Or
MirrorAction::MIRROR_HORIZONTAL

@return \Jaguar\Action\Mirror

@throws \InvalidArgumentException
357759
public function setDirection($direction)
    {
        if (!in_array($direction, self::$Supporteddirection)) {
            throw new \InvalidArgumentException(sprintf(
                    '"%s" Is Not Valid Mirror Direction', (string) $direction
            ));
        }
        $this->direction = $direction;

        return $this;
    }
439733
protected function setOrderByDirection($direction)
    {
        $direction = strtolower($direction);

        if ($direction == 'desc' || $direction == 'asc') {
            $this->orderByDirection = $direction;
        }
    }
265540
public function setOrderDirection($direction)
    {

        $direction = strtolower($direction);

        if (!in_array($direction, ['asc', 'desc'])) {
            throw new \InvalidArgumentException('$direction must be "asc" or "desc"');
        }

        $this->orderDirection = $direction;
        return $this;
    }
498108
public function setScreenOrientation($orientation)
    {
        $orientation = mb_strtoupper($orientation);
        if (!in_array($orientation, ['PORTRAIT', 'LANDSCAPE'])) {
            throw new IndexOutOfBoundsException(
                'Orientation must be either PORTRAIT, or LANDSCAPE'
            );
        }

        $this->executor->execute(
            DriverCommand::SET_SCREEN_ORIENTATION,
            ['orientation' => $orientation]
        );

        return $this;
    }
464703
public function setDirection($direction)
    {
        if ($direction === null) {
            $this->direction = $direction;
            return $this;
        }

        if (!is_string($direction)) {
            throw new InvalidArgumentException(
                'Direction must be a string.'
            );
        }

        $this->direction = strtolower($direction) === 'asc' ? 'ASC' : 'DESC';
        return $this;
    }
152936
public function rotate($degrees)
    {
        // Cast to the int, in case we got a numeric string
        $degrees = (int) $degrees;

        $this->image = imagerotate($this->image, $degrees, 0);
        $this->width = imagesx($this->image);
        $this->height = imagesy($this->image);

        return $this;
    }
970484
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;
    }
1180695
public function setAction($action)
    {
        if (!is_string($action) && !is_callable($action)) {
            throw new \LogicException(sprintf('Route action given "%s" is invalid. String or Callable expected.', gettype($action)));
        }
        $this->action = $action;
        
        return $this;
    }
1332417
public function setSorting($sortingName, $direction = 'asc')
    {
        $value = $sortingName . ' ' . $direction;
        $path = $this->prefixWithNamespace('sort');
        $this->argumentsAccessor->set($path, $value);
        $this->stateChanged = true;
        return $this;
    }
1108976
public function changeOrdering($direction)
    {
        $allowedDirections = array('asc', 'desc');
        $direction = strtolower($direction);
        $isInArray = in_array($direction, $allowedDirections, true);
        if (!empty($direction) && $isInArray) {
            if ($direction == 'asc') {
                $direction = 'desc';
            } else {
                $direction = 'asc';
            }
        }
        return $direction;
    }
1131430
public function flip($direction = Image::FLIP_HORIZONTAL): Image
	{
		$this->processor->flip($direction);

		return $this;
	}
503339
public function setDirection(int $pin, string $direction, bool $invert = false): bool
    {
        $this->export($pin);
        system("echo {$direction} > /sys/class/gpio/gpio{$pin}/direction");

        if ($invert) {
            $inverted = intval($invert);
            system("echo {$inverted} > /sys/class/gpio/gpio{$pin}/active_low");
        }

        if (file_exists("/sys/class/gpio/gpio{$pin}/direction") && (file_get_contents("/sys/class/gpio/gpio{$pin}/direction") == $direction)) {
            return true;
        }

        return false;

    }
1309229
public function setReverse($reverse)
    {
        if (is_bool($reverse) === true) {
            $this->reverse = $reverse;
        } else {
            $msg = "The 'reverse' argument must be a boolean value, '" . gettype($reverse) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
821589
public function setAction($action)
    {
        foreach ($this->routes as $route)
            $route->setAction($action);
        return $this;
    }
330239
protected function initDirection( string $direction )
   {

      // Convert the direction to UPPER case
      $direction = \strtoupper( \trim( $direction ) );

      if ( \strlen( $direction ) != 1 )
      {
         // Bad Format
         throw new GISError(
            GISError::ERROR_TYPE_DIRECTION,
            \sprintf( "'%s' is not allowed.", $direction )
         );
      }

      if ( 'O' == $direction )
      {
         // Convert O to E
         $direction = 'E';
      }

      // Define the allowed 2 direction values
      $allowedDirections = $this->properties[ 'islatitude' ] ? array( 'N', 'S' ) : array( 'E', 'W' );

      if ( ! \in_array( $direction, $allowedDirections ) )
      {
         // Not allowed value
         throw new GISError(
            GISError::ERROR_TYPE_DIRECTION,
            \sprintf(
               "'%s' isnt allowed. Please use '%s'",
               $direction,
               \join( "' or '", $allowedDirections )
            )
         );
      }

      $this->properties[ 'direction' ] = $direction;

   }
207124
public function orderBy($key, $direction = 'ASC')
    {
        if (Helpers\Validate::table($this->name)->field($key))
        {
            $directions                        = array(
                'ASC'  => SORT_ASC,
                'DESC' => SORT_DESC
            );
            $this->pending[__FUNCTION__][$key] = isset($directions[$direction]) ? $directions[$direction] : 'ASC';
        }

        return $this;
    }
973417
public static function validate(string $direction)
    {
        if (!isset(self::$directions[$direction])) {
            throw InvalidArgumentException::format(
                    'Invalid ordering direction: expecting one of (%s), \'%s\' given',
                    Debug::formatValues(array_keys(self::$directions)), $direction
            );
        }
    }