/** * Construct a new gravity action * * @param \Karla\Program $program * The program to use * @param string $gravity * Gravity * * @throws \InvalidArgumentException If the supplied gravity is not supported by imagemagick. */ public function __construct($program, $gravity) { if (!Support::gravity($program, $gravity)) { $message = 'The supplied gravity (' . $gravity . ') is not supported by imagemagick'; throw new \InvalidArgumentException($message); } $this->gravity = $gravity; }