Code Duplication    Length = 10-10 lines in 3 locations

src/Charcoal/Image/Effect/AbstractCropEffect.php 1 location

@@ 183-192 (lines=10) @@
180
     * @throws InvalidArgumentException If the argument is not a valid gravity name.
181
     * @return AbstractCropEffect
182
     */
183
    public function setGravity($gravity)
184
    {
185
        if (!in_array($gravity, $this->image()->availableGravities())) {
186
            throw new InvalidArgumentException(
187
                'Gravity is not valid'
188
            );
189
        }
190
        $this->gravity = $gravity;
191
        return $this;
192
    }
193
194
    /**
195
     * @return string

src/Charcoal/Image/Effect/AbstractResizeEffect.php 1 location

@@ 283-292 (lines=10) @@
280
     * @throws InvalidArgumentException If the argument is not a valid gravity name.
281
     * @return AbstractWatermarkEffect Chainable
282
     */
283
    public function setGravity($gravity)
284
    {
285
        if (!in_array($gravity, $this->image()->availableGravities())) {
286
            throw new InvalidArgumentException(
287
                'Gravity is not valid'
288
            );
289
        }
290
        $this->gravity = $gravity;
291
        return $this;
292
    }
293
294
    /**
295
     * @return string

src/Charcoal/Image/Effect/LayerEffectTrait.php 1 location

@@ 67-76 (lines=10) @@
64
     * @throws InvalidArgumentException If the argument is not a valid gravity name.
65
     * @return AbstractMaskEffect Chainable
66
     */
67
    public function setGravity($gravity)
68
    {
69
        if (!in_array($gravity, $this->image()->availableGravities())) {
70
            throw new InvalidArgumentException(
71
                'Gravity is not valid'
72
            );
73
        }
74
        $this->gravity = $gravity;
75
        return $this;
76
    }
77
78
    /**
79
     * @return string