Code Duplication    Length = 24-24 lines in 2 locations

typo3/sysext/core/Classes/Migrations/TcaMigration.php 2 locations

@@ 1258-1281 (lines=24) @@
1255
                            if (empty($fieldConfig['config']['wizards'])) {
1256
                                unset($fieldConfig['config']['wizards']);
1257
                            }
1258
                            if (isset($tableDefinition['types']) && is_array($tableDefinition['types'])) {
1259
                                foreach ($tableDefinition['types'] as $typeName => &$typeArray) {
1260
                                    if (isset($typeArray['columnsOverrides']) && is_array($typeArray['columnsOverrides'])) {
1261
                                        if (isset($typeArray['columnsOverrides'][$fieldName]['config']['wizards'])
1262
                                            && is_array($typeArray['columnsOverrides'][$fieldName]['config']['wizards'])
1263
                                        ) {
1264
                                            foreach ($typeArray['columnsOverrides'][$fieldName]['config']['wizards'] as $wizardName => $wizard) {
1265
                                                if (isset($wizard['type']) && ($wizard['type'] === 'colorbox')) {
1266
                                                    unset($typeArray['columnsOverrides'][$fieldName]['config']['wizards'][$wizardName]);
1267
                                                    $typeArray['columnsOverrides'][$fieldName]['config']['type'] = 'input';
1268
                                                    $typeArray['columnsOverrides'][$fieldName]['config']['renderType'] = 'colorpicker';
1269
                                                    $this->messages[] = 'The color-picker wizard in columnsOverrides using \'colorbox\' has been migrated to a \'rendertype\' = \'colorpicker\'.'
1270
                                                        . ' It has been migrated from TCA "' . $table . '[\'types\'][\'' . $typeName . '\'][\'columnsOverrides\'][\'config\']'
1271
                                                        . '[\'wizards\'][\'' . $wizardName . '\'][\'type\'] = \'colorbox\'"" to "' . $table
1272
                                                        . '[\'types\'][\'' . $typeName . '\'][\'columnsOverrides\'][\'config\'][\'renderType\'] = \'colorpicker\'"';
1273
                                                }
1274
                                            }
1275
                                            if (empty($typeArray['columnsOverrides'][$fieldName]['config']['wizards'])) {
1276
                                                unset($typeArray['columnsOverrides'][$fieldName]['config']['wizards']);
1277
                                            }
1278
                                        }
1279
                                    }
1280
                                }
1281
                            }
1282
                        }
1283
                    }
1284
                }
@@ 1397-1420 (lines=24) @@
1394
                        if (empty($fieldConfig['config']['wizards'])) {
1395
                            unset($fieldConfig['config']['wizards']);
1396
                        }
1397
                        if (isset($tableDefinition['types']) && is_array($tableDefinition['types'])) {
1398
                            foreach ($tableDefinition['types'] as $typeName => &$typeArray) {
1399
                                if (isset($typeArray['columnsOverrides']) && is_array($typeArray['columnsOverrides'])) {
1400
                                    if (isset($typeArray['columnsOverrides'][$fieldName]['config']['wizards'])
1401
                                        && is_array($typeArray['columnsOverrides'][$fieldName]['config']['wizards'])
1402
                                    ) {
1403
                                        foreach ($typeArray['columnsOverrides'][$fieldName]['config']['wizards'] as $wizardName => $wizard) {
1404
                                            if (isset($wizard['type']) && ($wizard['type'] === 'slider')) {
1405
                                                $typeArray['columnsOverrides'][$fieldName]['config']['slider'] = $wizard;
1406
                                                unset($typeArray['columnsOverrides'][$fieldName]['config']['wizards'][$wizardName]);
1407
                                                unset($typeArray['columnsOverrides'][$fieldName]['config']['slider']['type']);
1408
                                                $this->messages[] = 'The slider wizard in columnsOverrides using \'type\' = \'slider\' has been migrated'
1409
                                                    . ' from TCA ' . $table . '[\'types\'][\'' . $typeName . '\'][\'columnsOverrides\'][\'config\']'
1410
                                                    . '[\'wizards\'][\'' . $wizardName . '\'] to ' . $table
1411
                                                    . '[\'types\'][\'' . $typeName . '\'][\'columnsOverrides\'][\'config\'][\'slider\']';
1412
                                            }
1413
                                        }
1414
                                        if (empty($typeArray['columnsOverrides'][$fieldName]['config']['wizards'])) {
1415
                                            unset($typeArray['columnsOverrides'][$fieldName]['config']['wizards']);
1416
                                        }
1417
                                    }
1418
                                }
1419
                            }
1420
                        }
1421
                    }
1422
                }
1423
            }