Code Duplication    Length = 9-9 lines in 2 locations

src/Forms/TreeMultiselectField.php 1 location

@@ 194-202 (lines=9) @@
191
    /**
192
     * Changes this field to the readonly field.
193
     */
194
    public function performReadonlyTransformation()
195
    {
196
        $copy = $this->castedCopy('SilverStripe\\Forms\\TreeMultiselectField_Readonly');
197
        $copy->setKeyField($this->keyField);
198
        $copy->setLabelField($this->labelField);
199
        $copy->setSourceObject($this->sourceObject);
200
201
        return $copy;
202
    }
203
}
204

src/Forms/TreeDropdownField.php 1 location

@@ 630-638 (lines=9) @@
627
    /**
628
     * Changes this field to the readonly field.
629
     */
630
    public function performReadonlyTransformation()
631
    {
632
        /** @var TreeDropdownField_Readonly $copy */
633
        $copy = $this->castedCopy(TreeDropdownField_Readonly::class);
634
        $copy->setKeyField($this->keyField);
635
        $copy->setLabelField($this->labelField);
636
        $copy->setSourceObject($this->sourceObject);
637
        return $copy;
638
    }
639
    
640
    /**
641
     * @param string|FormField $classOrCopy