Code Duplication    Length = 5-5 lines in 2 locations

forms/CompositeField.php 2 locations

@@ 330-334 (lines=5) @@
327
	public function performReadonlyTransformation() {
328
		$newChildren = new FieldList();
329
		$clone = clone $this;
330
		if($clone->getChildren()) foreach($clone->getChildren() as $child) {
331
			/** @var FormField $child */
332
			$child = $child->transform(new ReadonlyTransformation());
333
			$newChildren->push($child);
334
		}
335
336
		$clone->setChildren($newChildren);
337
		$clone->setReadonly(true);
@@ 353-357 (lines=5) @@
350
	public function performDisabledTransformation() {
351
		$newChildren = new FieldList();
352
		$clone = clone $this;
353
		if($clone->getChildren()) foreach($clone->getChildren() as $child) {
354
			/** @var FormField $child */
355
			$child = $child->transform(new DisabledTransformation());
356
			$newChildren->push($child);
357
		}
358
359
		$clone->setChildren($newChildren);
360
		$clone->setDisabled(true);