Code Duplication    Length = 27-27 lines in 2 locations

Guesser/PropelORMFieldGuesser.php 2 locations

@@ 181-207 (lines=27) @@
178
     * @param $columnName: for debug only
179
     * @return string
180
     */
181
    public function getFormType($dbType, $class, $columnName)
182
    {
183
        $formTypes = array();
184
185
        foreach ($this->formTypes as $key => $value) {
186
            // if config is all uppercase use it to retrieve \PropelColumnTypes
187
            // constant, otherwise use it literally
188
            if ($key === strtoupper($key)) {
189
                $key = constant('\PropelColumnTypes::'.$key);
190
            }
191
192
            $formTypes[$key] = $value;
193
        }
194
195
        if (array_key_exists($dbType, $formTypes)) {
196
            return $formTypes[$dbType];
197
        }
198
199
        if ('virtual' === $dbType) {
200
            return 'virtual_form';
201
        }
202
203
        throw new NotImplementedException(
204
            'The dbType "'.$dbType.'" is not yet implemented '
205
            .'(column "'.$columnName.'" in "'.$class.'")'
206
        );
207
    }
208
209
    /**
210
     * @param $dbType
@@ 214-240 (lines=27) @@
211
     * @param $columnName
212
     * @return string
213
     */
214
    public function getFilterType($dbType, $class, $columnName)
215
    {
216
        $filterTypes = array();
217
218
        foreach ($this->filterTypes as $key => $value) {
219
            // if config is all uppercase use it to retrieve \PropelColumnTypes
220
            // constant, otherwise use it literally
221
            if ($key === strtoupper($key)) {
222
                $key = constant('\PropelColumnTypes::'.$key);
223
            }
224
225
            $filterTypes[$key] = $value;
226
        }
227
228
        if (array_key_exists($dbType, $filterTypes)) {
229
            return $filterTypes[$dbType];
230
        }
231
232
        if ('virtual' === $dbType) {
233
            return 'virtual_filter';
234
        }
235
236
        throw new NotImplementedException(
237
            'The dbType "'.$dbType.'" is not yet implemented '
238
            .'(column "'.$columnName.'" in "'.$class.'")'
239
        );
240
    }
241
242
    /**
243
     * @param $formType