Code Duplication    Length = 3-3 lines in 4 locations

lib/Doctrine/ODM/MongoDB/Tools/DocumentGenerator.php 4 locations

@@ 683-685 (lines=3) @@
680
                }
681
            } elseif ($fieldMapping['type'] === ClassMetadataInfo::ONE) {
682
                $nullable = $this->isAssociationNullable($fieldMapping) ? 'null' : null;
683
                if ($code = $this->generateDocumentStubMethod($metadata, 'set', $fieldMapping['fieldName'], isset($fieldMapping['targetDocument']) ? $fieldMapping['targetDocument'] : null, $nullable)) {
684
                    $methods[] = $code;
685
                }
686
                if ($code = $this->generateDocumentStubMethod($metadata, 'get', $fieldMapping['fieldName'], isset($fieldMapping['targetDocument']) ? $fieldMapping['targetDocument'] : null)) {
687
                    $methods[] = $code;
688
                }
@@ 686-688 (lines=3) @@
683
                if ($code = $this->generateDocumentStubMethod($metadata, 'set', $fieldMapping['fieldName'], isset($fieldMapping['targetDocument']) ? $fieldMapping['targetDocument'] : null, $nullable)) {
684
                    $methods[] = $code;
685
                }
686
                if ($code = $this->generateDocumentStubMethod($metadata, 'get', $fieldMapping['fieldName'], isset($fieldMapping['targetDocument']) ? $fieldMapping['targetDocument'] : null)) {
687
                    $methods[] = $code;
688
                }
689
            } elseif ($fieldMapping['type'] === ClassMetadataInfo::MANY) {
690
                if ($code = $this->generateDocumentStubMethod($metadata, 'add', $fieldMapping['fieldName'], isset($fieldMapping['targetDocument']) ? $fieldMapping['targetDocument'] : null)) {
691
                    $methods[] = $code;
@@ 690-692 (lines=3) @@
687
                    $methods[] = $code;
688
                }
689
            } elseif ($fieldMapping['type'] === ClassMetadataInfo::MANY) {
690
                if ($code = $this->generateDocumentStubMethod($metadata, 'add', $fieldMapping['fieldName'], isset($fieldMapping['targetDocument']) ? $fieldMapping['targetDocument'] : null)) {
691
                    $methods[] = $code;
692
                }
693
                if ($code = $this->generateDocumentStubMethod($metadata, 'remove', $fieldMapping['fieldName'], isset($fieldMapping['targetDocument']) ? $fieldMapping['targetDocument'] : null)) {
694
                    $methods[] = $code;
695
                }
@@ 693-695 (lines=3) @@
690
                if ($code = $this->generateDocumentStubMethod($metadata, 'add', $fieldMapping['fieldName'], isset($fieldMapping['targetDocument']) ? $fieldMapping['targetDocument'] : null)) {
691
                    $methods[] = $code;
692
                }
693
                if ($code = $this->generateDocumentStubMethod($metadata, 'remove', $fieldMapping['fieldName'], isset($fieldMapping['targetDocument']) ? $fieldMapping['targetDocument'] : null)) {
694
                    $methods[] = $code;
695
                }
696
                if ($code = $this->generateDocumentStubMethod($metadata, 'get', $fieldMapping['fieldName'], '\Doctrine\Common\Collections\Collection')) {
697
                    $methods[] = $code;
698
                }