Code Duplication    Length = 14-14 lines in 2 locations

src/Mailgun/Message/MessageBuilder.php 1 location

@@ 390-403 (lines=14) @@
387
     *
388
     * @return string
389
     */
390
    public function setDeliveryTime($timeDate, $timeZone = null)
391
    {
392
        if (null !== $timeZone) {
393
            $timeZoneObj = new \DateTimeZone($timeZone);
394
        } else {
395
            $timeZoneObj = new \DateTimeZone('UTC');
396
        }
397
398
        $dateTimeObj = new \DateTime($timeDate, $timeZoneObj);
399
        $formattedTimeDate = $dateTimeObj->format(\DateTime::RFC2822);
400
        $this->message['o:deliverytime'] = $formattedTimeDate;
401
402
        return $this->message['o:deliverytime'];
403
    }
404
405
    /**
406
     * @param string $customName

src/Mailgun/Messages/MessageBuilder.php 1 location

@@ 464-477 (lines=14) @@
461
     *
462
     * @return string
463
     */
464
    public function setDeliveryTime($timeDate, $timeZone = null)
465
    {
466
        if (isset($timeZone)) {
467
            $timeZoneObj = new \DateTimeZone("$timeZone");
468
        } else {
469
            $timeZoneObj = new \DateTimeZone(Api::DEFAULT_TIME_ZONE);
470
        }
471
472
        $dateTimeObj = new \DateTime($timeDate, $timeZoneObj);
473
        $formattedTimeDate = $dateTimeObj->format(\DateTime::RFC2822);
474
        $this->message['o:deliverytime'] = $formattedTimeDate;
475
476
        return $this->message['o:deliverytime'];
477
    }
478
479
    /**
480
     * @param string $customName