Code Duplication    Length = 10-10 lines in 2 locations

code/Forms/RemoteFileFormFactory.php 1 location

@@ 241-250 (lines=10) @@
238
            ])->addExtraClass('flexbox-area-grow'),
239
        ])->addExtraClass('insert-embed-modal__fields--fill-width');
240
241
        if ($dimensions && $width && $height) {
242
            $ratio = $width / $height;
243
244
            $dimensions->setSchemaComponent('ProportionConstraintField');
245
            $dimensions->setSchemaState([
246
                'data' => [
247
                    'ratio' => $ratio
248
                ]
249
            ]);
250
        }
251
        return FieldList::create($fields);
252
    }
253
}

code/Forms/ImageFormFactory.php 1 location

@@ 115-124 (lines=10) @@
112
                $height = $record->getHeight();
113
            }
114
    
115
            if ($width && $height) {
116
                $ratio = $width / $height;
117
        
118
                $dimensions->setSchemaComponent('ProportionConstraintField');
119
                $dimensions->setSchemaState([
120
                    'data' => [
121
                        'ratio' => $ratio
122
                    ]
123
                ]);
124
            }
125
        });
126
127
        return parent::getForm($controller, $name, $context);