Code Duplication    Length = 10-10 lines in 2 locations

lib/Doctrine/ORM/Mapping/Driver/NewAnnotationDriver.php 1 location

@@ 1108-1117 (lines=10) @@
1105
     *
1106
     * @throws Mapping\MappingException If the fetch mode is not valid.
1107
     */
1108
    private function getFetchMode($className, $fetchMode)
1109
    {
1110
        $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode);
1111
1112
        if (! defined($fetchModeConstant)) {
1113
            throw Mapping\MappingException::invalidFetchMode($className, $fetchMode);
1114
        }
1115
1116
        return constant($fetchModeConstant);
1117
    }
1118
1119
    /**
1120
     * @param string $className        The class name.

lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php 1 location

@@ 1258-1267 (lines=10) @@
1255
     *
1256
     * @throws Mapping\MappingException If the fetch mode is not valid.
1257
     */
1258
    private function getFetchMode($className, $fetchMode) : string
1259
    {
1260
        $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode);
1261
1262
        if ( ! defined($fetchModeConstant)) {
1263
            throw Mapping\MappingException::invalidFetchMode($className, $fetchMode);
1264
        }
1265
1266
        return constant($fetchModeConstant);
1267
    }
1268
1269
    /**
1270
     * Parses the given method.