Code Duplication    Length = 17-18 lines in 4 locations

core/db_classes/EE_Datetime.class.php 4 locations

@@ 252-269 (lines=18) @@
249
     * @throws InvalidDataTypeException
250
     * @throws EE_Error
251
     */
252
    public function increaseSold($qty = 1)
253
    {
254
        $qty = absint($qty);
255
        $success = $this->bump(
256
            [
257
                'DTT_reserved' => $qty * -1,
258
                'DTT_sold' => $qty
259
            ]
260
        );
261
        do_action(
262
            'AHEE__EE_Datetime__increase_sold',
263
            $this,
264
            $qty,
265
            $this->sold(),
266
            $success
267
        );
268
        return $success;
269
    }
270
271
272
    /**
@@ 284-300 (lines=17) @@
281
     * @throws InvalidDataTypeException
282
     * @throws EE_Error
283
     */
284
    public function decreaseSold($qty = 1)
285
    {
286
        $qty = absint($qty);
287
        $success = $this->bump(
288
            [
289
                'DTT_sold' => $qty * -1
290
            ]
291
        );
292
        do_action(
293
            'AHEE__EE_Datetime__decrease_sold',
294
            $this,
295
            $qty,
296
            $this->sold(),
297
            $success
298
        );
299
        return $success;
300
    }
301
302
303
    /**
@@ 348-365 (lines=18) @@
345
     * @throws InvalidDataTypeException
346
     * @throws EE_Error
347
     */
348
    public function increaseReserved($qty = 1)
349
    {
350
        $qty = absint($qty);
351
        $success = $this->bumpConditionally(
352
            'DTT_reserved',
353
            'DTT_sold',
354
            'DTT_reg_limit',
355
            $qty
356
        );
357
        do_action(
358
            'AHEE__EE_Datetime__increase_reserved',
359
            $this,
360
            $qty,
361
            $this->reserved(),
362
            $success
363
        );
364
        return $success;
365
    }
366
367
368
    /**
@@ 379-395 (lines=17) @@
376
     * @throws InvalidDataTypeException
377
     * @throws EE_Error
378
     */
379
    public function decreaseReserved($qty = 1)
380
    {
381
        $qty = absint($qty);
382
        $success = $this->bump(
383
            [
384
                'DTT_reserved' => $qty * -1
385
            ]
386
        );
387
        do_action(
388
            'AHEE__EE_Datetime__decrease_reserved',
389
            $this,
390
            $qty,
391
            $this->reserved(),
392
            $success
393
        );
394
        return $success;
395
    }
396
397
398
    /**