Code Duplication    Length = 10-10 lines in 3 locations

src/SilverStripe/BehatExtension/Context/BasicContext.php 3 locations

@@ 558-567 (lines=10) @@
555
     *
556
     * @Transform /^(?:(the|a)) time of (?<val>.*)$/
557
     */
558
    public function castRelativeToAbsoluteTime($prefix, $val)
559
    {
560
        $timestamp = strtotime($val);
561
        if (!$timestamp) {
562
            throw new \InvalidArgumentException(sprintf(
563
                "Can't resolve '%s' into a valid datetime value",
564
                $val
565
            ));
566
        }
567
        return date($this->timeFormat, $timestamp);
568
    }
569
570
    /**
@@ 577-586 (lines=10) @@
574
     *
575
     * @Transform /^(?:(the|a)) datetime of (?<val>.*)$/
576
     */
577
    public function castRelativeToAbsoluteDatetime($prefix, $val)
578
    {
579
        $timestamp = strtotime($val);
580
        if (!$timestamp) {
581
            throw new \InvalidArgumentException(sprintf(
582
                "Can't resolve '%s' into a valid datetime value",
583
                $val
584
            ));
585
        }
586
        return date($this->datetimeFormat, $timestamp);
587
    }
588
589
    /**
@@ 596-605 (lines=10) @@
593
     *
594
     * @Transform /^(?:(the|a)) date of (?<val>.*)$/
595
     */
596
    public function castRelativeToAbsoluteDate($prefix, $val)
597
    {
598
        $timestamp = strtotime($val);
599
        if (!$timestamp) {
600
            throw new \InvalidArgumentException(sprintf(
601
                "Can't resolve '%s' into a valid datetime value",
602
                $val
603
            ));
604
        }
605
        return date($this->dateFormat, $timestamp);
606
    }
607
608
    public function getDateFormat()