Code Duplication    Length = 20-20 lines in 2 locations

src/Oro/Bundle/SalesBundle/Migrations/Schema/v1_22/UpdateReportQuery.php 1 location

@@ 117-136 (lines=20) @@
114
     * @param $oldField
115
     * @param $newField
116
     */
117
    protected function fixSegmentDefs(LoggerInterface $logger, $dryRun, $def, $row, $className, $oldField, $newField)
118
    {
119
        if (isset($def['columns'])) {
120
            foreach ($def['columns'] as $key => $field) {
121
                if (isset($field['name']) && $row['entity'] === $className && $field['name'] === $oldField) {
122
                    $def['columns'][$key]['name'] = $newField;
123
                    $this->updateSegment($logger, $dryRun, $def, $row);
124
                }
125
            }
126
        }
127
        if (isset($def['filters'])) {
128
            foreach ($def['filters'] as $key => $field) {
129
                if (isset($field['columnName'])) {
130
                    $def = $this->processFilterDefinition($def, $row, $className, $oldField, $newField, $field, $key);
131
                    $def = $this->fixFilterCriterion($def, $field, $key);
132
                    $this->updateSegment($logger, $dryRun, $def, $row);
133
                }
134
            }
135
        }
136
    }
137
138
    /**
139
     * @param LoggerInterface $logger

src/Oro/Bundle/SalesBundle/Migrations/Schema/v1_24/UpdateReport.php 1 location

@@ 139-158 (lines=20) @@
136
     * @param string $oldField
137
     * @param string $newField
138
     */
139
    protected function fixSegmentDefs(LoggerInterface $logger, $dryRun, $def, $row, $className, $oldField, $newField)
140
    {
141
        if (isset($def['columns'])) {
142
            foreach ($def['columns'] as $key => $field) {
143
                if (isset($field['name']) && $row['entity'] === $className && $field['name'] === $oldField) {
144
                    $def['columns'][$key]['name'] = $newField;
145
                    $this->updateSegment($logger, $dryRun, $def, $row);
146
                }
147
            }
148
        }
149
        if (isset($def['filters'])) {
150
            foreach ($def['filters'] as $key => $field) {
151
                if (isset($field['columnName'])) {
152
                    $def = $this->processFilterDefinition($def, $row, $className, $oldField, $newField, $field, $key);
153
                    $def = $this->fixFilterCriterion($def, $field, $key);
154
                    $this->updateSegment($logger, $dryRun, $def, $row);
155
                }
156
            }
157
        }
158
    }
159
160
    /**
161
     * @param LoggerInterface $logger