Code Duplication    Length = 12-14 lines in 2 locations

lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php 2 locations

@@ 157-170 (lines=14) @@
154
155
        foreach ($classMetadata->getDeclaredPropertiesIterator() as $property) {
156
            switch (true) {
157
                case ($property instanceof FieldMetadata):
158
                    $columnName  = $property->getColumnName();
159
                    $columnAlias = $platform->getSQLResultCasing(
160
                        $this->getColumnAlias($columnName, $renameMode, $customRenameColumns)
161
                    );
162
163
                    if (isset($this->fieldMappings[$columnAlias])) {
164
                        throw new \InvalidArgumentException(
165
                            sprintf("The column '%s' conflicts with another column in the mapper.", $columnName)
166
                        );
167
                    }
168
169
                    $this->addFieldResult($alias, $columnAlias, $property->getName());
170
                    break;
171
172
                case ($property instanceof ToOneAssociationMetadata && $property->isOwningSide()):
173
                    $targetClass = $this->em->getClassMetadata($property->getTargetEntity());
@@ 391-402 (lines=12) @@
388
        } else {
389
            foreach ($classMetadata->getDeclaredPropertiesIterator() as $property) {
390
                switch (true) {
391
                    case ($property instanceof FieldMetadata):
392
                        $columnName  = $property->getColumnName();
393
                        $columnAlias = $platform->getSQLResultCasing($columnName);
394
395
                        if (isset($this->fieldMappings[$columnAlias])) {
396
                            throw new \InvalidArgumentException(
397
                                sprintf("The column '%s' conflicts with another column in the mapper.", $columnName)
398
                            );
399
                        }
400
401
                        $this->addFieldResult($alias, $columnAlias, $property->getName());
402
                        break;
403
404
                    case ($property instanceof ToOneAssociationMetadata && $property->isOwningSide()):
405
                        $targetClass = $this->em->getClassMetadata($property->getTargetEntity());