Code Duplication    Length = 6-8 lines in 2 locations

lib/Doctrine/ODM/MongoDB/Query/FieldExtractor.php 2 locations

@@ 49-54 (lines=6) @@
46
                foreach ($elemMatchFields as $field) {
47
                    $fields[] = $k.'.'.$field;
48
                }
49
            } elseif ($this->isOperator($k, array('and', 'or'))) {
50
                foreach ($v as $q) {
51
                    $test = new self($q);
52
                    $fields = array_merge($fields, $test->getFields());
53
                }
54
            } elseif ($k[0] !== '$') {
55
                $fields[] = $k;
56
            }
57
        }
@@ 70-77 (lines=8) @@
67
                continue;
68
            }
69
70
            if ($this->isOperator($fieldName, array('and', 'or'))) {
71
                foreach ($value as $q) {
72
                    $test = new self($q);
73
                    $fields = array_merge($fields, $test->getFields());
74
                }
75
            } else {
76
                $fields[] = $fieldName;
77
            }
78
        }
79
        return $fields;
80
    }