protected function doTransform(Matrix $mA, $extra = null)
    {
        if (is_null($extra)) {
            $extra = self::ROT_90;
        } else {
            if (!array_key_exists($extra, $this->rotationMatrices)) {
                throw new TransformationException('Rotation angle not supported');
            }
        }

        //simple cases
        if ($mA->is('empty') || $mA->is('singleitem')) {
            return clone $mA;
        }

        $this->assertMatrixIsComplete($mA);

        return $this->rotate($mA, $this->rotationMatrices[$extra]);
    }
protected function doTransform(Matrix $mA, $extra = null)
    {
        if (is_null($extra)) {
            $extra = self::ROT_90;
        } else {
            if (!array_key_exists($extra, $this->rotationMatrices)) {
                throw new TransformationException('Rotation angle not supported');
            }
        }

        //simple cases
        if ($mA->is('empty') || $mA->is('singleitem')) {
            return clone $mA;
        }

        $this->assertMatrixIsComplete($mA);

        return $this->rotate($mA, $this->rotationMatrices[$extra]);
    }
protected function doTransform ( Matrix $ mA , $ extra = null ) { if ( is_null ( $ extra ) ) { $ extra = self :: ROT_90 ; } else { if ( ! array_key_exists ( $ extra , $ this -> rotationMatrices ) ) { throw new TransformationException ( 'Rotation angle not supported' ) ; } } //simple cases if ( $ mA -> is ( 'empty' ) || $ mA -> is ( 'singleitem' ) ) { return clone $ mA ; } $ this -> assertMatrixIsComplete ( $ mA ) ; return $ this -> rotate ( $ mA , $ this -> rotationMatrices [ $ extra ] ) ; }
Rotate the matrix through 90, 180 or 270 degrees

@param Matrix $mA First matrix operand - required
@param int $extra Rotation degrees - default null = self::ROT_90 (counter clockwise)

@return Matrix

@throws \Chippyash\Matrix\Exceptions\TransformationException
Rotate the matrix through 90 180 or 270 degrees