Code Duplication    Length = 14-15 lines in 2 locations

src/Charcoal/Object/ObjectRoute.php 1 location

@@ 243-257 (lines=15) @@
240
     * @throws InvalidArgumentException If the slug argument is not a string.
241
     * @return self
242
     */
243
    public function setSlug($slug)
244
    {
245
        if ($slug === null) {
246
            $this->slug = null;
247
248
            return $this;
249
        }
250
        if (!is_string($slug)) {
251
            throw new InvalidArgumentException(
252
                'Slug is not a string'
253
            );
254
        }
255
        $this->slug = $slug;
256
257
        return $this;
258
    }
259
260
    /**

src/Charcoal/Object/ObjectRevision.php 1 location

@@ 196-209 (lines=14) @@
193
     * @throws InvalidArgumentException If the revision user parameter is not a string.
194
     * @return ObjectRevision Chainable
195
     */
196
    public function setRevUser($revUser)
197
    {
198
        if ($revUser === null) {
199
            $this->revUser = null;
200
            return $this;
201
        }
202
        if (!is_string($revUser)) {
203
            throw new InvalidArgumentException(
204
                'Revision user must be a string.'
205
            );
206
        }
207
        $this->revUser = $revUser;
208
        return $this;
209
    }
210
211
    /**
212
     * @return string