Code Duplication    Length = 8-10 lines in 2 locations

src/Forms/DatetimeField.php 1 location

@@ 652-661 (lines=10) @@
649
     * @param string $timezone
650
     * @return $this
651
     */
652
    public function setTimezone($timezone)
653
    {
654
        if ($this->value && $timezone !== $this->timezone) {
655
            throw new \BadMethodCallException("Can't change timezone after setting a value");
656
        }
657
658
        $this->timezone = $timezone;
659
660
        return $this;
661
    }
662
}
663

src/Forms/TimeField.php 1 location

@@ 470-477 (lines=8) @@
467
     * @param string $timezone
468
     * @return $this
469
     */
470
    public function setTimezone($timezone)
471
    {
472
        if ($this->value && $timezone !== $this->timezone) {
473
            throw new \BadMethodCallException("Can't change timezone after setting a value");
474
        }
475
        $this->timezone = $timezone;
476
        return $this;
477
    }
478
479
480
    /**