Code Duplication    Length = 8-8 lines in 2 locations

class.json-api-endpoints.php 2 locations

@@ 417-424 (lines=8) @@
414
				}
415
			}
416
417
			if ( isset( $type['children'] ) ) {
418
				$children = array();
419
				foreach ( (array) $value as $k => $child ) {
420
					$this->cast_and_filter_item( $children, $type['children'], $k, $child, array(), $for_output );
421
				}
422
				$return[$key] = (array) $children;
423
				break;
424
			}
425
426
			$return[$key] = (array) $value;
427
			break;
@@ 457-464 (lines=8) @@
454
				}
455
			}
456
457
			if ( isset( $type['children'] ) ) {
458
				$children = array();
459
				foreach ( (array) $value as $k => $child ) {
460
					$this->cast_and_filter_item( $children, $type['children'], $k, $child, array(), $for_output );
461
				}
462
				$return[$key] = (object) $children;
463
				break;
464
			}
465
466
			if ( isset( $type['subtype'] ) ) {
467
				return $this->cast_and_filter_item( $return, $type['subtype'], $key, $value, $types, $for_output );