Code Duplication    Length = 10-10 lines in 2 locations

code/Forms/ImageFormFactory.php 1 location

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

code/Forms/RemoteFileFormFactory.php 1 location

@@ 135-144 (lines=10) @@
132
                ])->addExtraClass('flexbox-area-grow'),
133
            ])->addExtraClass('insert-embed-modal__fields--fill-width');
134
    
135
            if ($dimensions && $width && $height) {
136
                $ratio = $width / $height;
137
        
138
                $dimensions->setSchemaComponent('ProportionConstraintField');
139
                $dimensions->setSchemaState([
140
                    'data' => [
141
                        'ratio' => $ratio
142
                    ]
143
                ]);
144
            }
145
        }
146
147
        return FieldList::create($fields);