Code Duplication    Length = 14-14 lines in 6 locations

lib/Doctrine/ORM/Mapping/Driver/NewAnnotationDriver.php 3 locations

@@ 1151-1164 (lines=14) @@
1148
     *
1149
     * @return array
1150
     */
1151
    private function getClassAnnotations(\ReflectionClass $reflectionClass)
1152
    {
1153
        $classAnnotations = $this->reader->getClassAnnotations($reflectionClass);
1154
1155
        foreach ($classAnnotations as $key => $annot) {
1156
            if (! is_numeric($key)) {
1157
                continue;
1158
            }
1159
1160
            $classAnnotations[get_class($annot)] = $annot;
1161
        }
1162
1163
        return $classAnnotations;
1164
    }
1165
1166
    /**
1167
     * @param \ReflectionProperty $reflectionProperty
@@ 1171-1184 (lines=14) @@
1168
     *
1169
     * @return array
1170
     */
1171
    private function getPropertyAnnotations(\ReflectionProperty $reflectionProperty)
1172
    {
1173
        $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty);
1174
1175
        foreach ($propertyAnnotations as $key => $annot) {
1176
            if (! is_numeric($key)) {
1177
                continue;
1178
            }
1179
1180
            $propertyAnnotations[get_class($annot)] = $annot;
1181
        }
1182
1183
        return $propertyAnnotations;
1184
    }
1185
1186
    /**
1187
     * @param \ReflectionMethod $reflectionMethod
@@ 1191-1204 (lines=14) @@
1188
     *
1189
     * @return array
1190
     */
1191
    private function getMethodAnnotations(\ReflectionMethod $reflectionMethod)
1192
    {
1193
        $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod);
1194
1195
        foreach ($methodAnnotations as $key => $annot) {
1196
            if (! is_numeric($key)) {
1197
                continue;
1198
            }
1199
1200
            $methodAnnotations[get_class($annot)] = $annot;
1201
        }
1202
1203
        return $methodAnnotations;
1204
    }
1205
}
1206

lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php 3 locations

@@ 1307-1320 (lines=14) @@
1304
     *
1305
     * @return array
1306
     */
1307
    private function getClassAnnotations(\ReflectionClass $reflectionClass) : array
1308
    {
1309
        $classAnnotations = $this->reader->getClassAnnotations($reflectionClass);
1310
1311
        foreach ($classAnnotations as $key => $annot) {
1312
            if (! is_numeric($key)) {
1313
                continue;
1314
            }
1315
1316
            $classAnnotations[get_class($annot)] = $annot;
1317
        }
1318
1319
        return $classAnnotations;
1320
    }
1321
1322
    /**
1323
     * @param \ReflectionProperty $reflectionProperty
@@ 1327-1340 (lines=14) @@
1324
     *
1325
     * @return array
1326
     */
1327
    private function getPropertyAnnotations(\ReflectionProperty $reflectionProperty) : array
1328
    {
1329
        $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty);
1330
1331
        foreach ($propertyAnnotations as $key => $annot) {
1332
            if (! is_numeric($key)) {
1333
                continue;
1334
            }
1335
1336
            $propertyAnnotations[get_class($annot)] = $annot;
1337
        }
1338
1339
        return $propertyAnnotations;
1340
    }
1341
1342
    /**
1343
     * @param \ReflectionMethod $reflectionMethod
@@ 1347-1360 (lines=14) @@
1344
     *
1345
     * @return array
1346
     */
1347
    private function getMethodAnnotations(\ReflectionMethod $reflectionMethod) : array
1348
    {
1349
        $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod);
1350
1351
        foreach ($methodAnnotations as $key => $annot) {
1352
            if (! is_numeric($key)) {
1353
                continue;
1354
            }
1355
1356
            $methodAnnotations[get_class($annot)] = $annot;
1357
        }
1358
1359
        return $methodAnnotations;
1360
    }
1361
1362
    /**
1363
     * Factory method for the Annotation Driver.