Code Duplication    Length = 10-12 lines in 2 locations

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

@@ 157-166 (lines=10) @@
154
     * @throws InvalidArgumentException If the geometry argument is not valid.
155
     * @return AbstractCropEffect
156
     */
157
    public function setGeometry($geometry)
158
    {
159
        if ($geometry !== null && !is_string($geometry) && !is_numeric($geometry)) {
160
            throw new InvalidArgumentException(
161
                'Geometry must be a valid crop'
162
            );
163
        }
164
        $this->geometry = $geometry;
165
        return $this;
166
    }
167
168
    /**
169
     * Retrieve the complex geometry value.

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

@@ 111-122 (lines=12) @@
108
     * @throws InvalidArgumentException If the size argument is not valid.
109
     * @return Rotate Chainable
110
     */
111
    public function setSize($size)
112
    {
113
        if ($size !== null && !is_string($size) && (!is_numeric($size) || ($size < 0))) {
114
            throw new InvalidArgumentException(
115
                'Size must be a valid scale'
116
            );
117
        }
118
119
        $this->size = $size;
120
121
        return $this;
122
    }
123
124
    /**
125
     * Retrieve the complex resize value.