public function flip(&$image, $mode){
        if ($mode === 'h') {
            $image->getCore()->flopImage();
        } else if ($mode === 'v') {
            $image->getCore()->flipImage();
        } else {
            throw new \Exception(sprintf('Unsupported mode "%s"', $mode));
        }
        return $this;
    }
public function flip(&$image, $mode){
        if ($mode === 'h') {
            $image->getCore()->flopImage();
        } else if ($mode === 'v') {
            $image->getCore()->flipImage();
        } else {
            throw new \Exception(sprintf('Unsupported mode "%s"', $mode));
        }
        return $this;
    }
public function flip ( & $ image , $ mode ) { if ( $ mode === 'h' ) { $ image -> getCore ( ) -> flopImage ( ) ; } else if ( $ mode === 'v' ) { $ image -> getCore ( ) -> flipImage ( ) ; } else { throw new \ Exception ( sprintf ( 'Unsupported mode "%s"' , $ mode ) ) ; } return $ this ; }
Flip or mirrors the image.

@param Image $image
@param string $mode The type of flip: 'h' for horizontal flip or 'v' for vertical.

@return Editor
@throws \Exception
Flip or mirrors the image .