Code Duplication    Length = 11-11 lines in 4 locations

src/Gmagick/Image.php 2 locations

@@ 124-134 (lines=11) @@
121
    /**
122
     * {@inheritdoc}
123
     */
124
    public function withType($type)
125
    {
126
        if (!isset(static::$typeMapping[$type])) {
127
            throw new RuntimeException('Unsupported image type');
128
        }
129
130
        $image = clone $this;
131
        $image->gmagick->setimagetype(static::$typeMapping[$type]);
132
133
        return $image;
134
    }
135
136
    /**
137
     * {@inheritdoc}
@@ 160-170 (lines=11) @@
157
    /**
158
     * {@inheritdoc}
159
     */
160
    public function withColorSpace($colorSpace)
161
    {
162
        if (!isset(static::$colorSpaceMapping[$colorSpace])) {
163
            throw new RuntimeException('Only RGB, grayscale and CMYK color space are currently supported');
164
        }
165
166
        $image = clone $this;
167
        $image->gmagick->setimagecolorspace(static::$colorSpaceMapping[$colorSpace]);
168
169
        return $image;
170
    }
171
172
    /**
173
     * {@inheritdoc}

src/Imagick/Image.php 2 locations

@@ 127-137 (lines=11) @@
124
    /**
125
     * {@inheritdoc}
126
     */
127
    public function withType($type)
128
    {
129
        if (!isset(static::$typeMapping[$type])) {
130
            throw new RuntimeException('Unsupported image type');
131
        }
132
133
        $image = clone $this;
134
        $image->imagick->setImageType(static::$typeMapping[$type]);
135
136
        return $image;
137
    }
138
139
    /**
140
     * {@inheritdoc}
@@ 160-170 (lines=11) @@
157
    /**
158
     * {@inheritdoc}
159
     */
160
    public function withColorSpace($colorSpace)
161
    {
162
        if (!isset(static::$colorSpaceMapping[$colorSpace])) {
163
            throw new RuntimeException('Only RGB, grayscale and CMYK color space are currently supported');
164
        }
165
166
        $image = clone $this;
167
        $image->imagick->setImageColorspace(static::$colorSpaceMapping[$colorSpace]);
168
169
        return $image;
170
    }
171
172
    /**
173
     * {@inheritdoc}