Code Duplication    Length = 8-8 lines in 2 locations

class.json-api-endpoints.php 2 locations

@@ 456-463 (lines=8) @@
453
				}
454
			}
455
456
			if ( isset( $type['children'] ) ) {
457
				$children = array();
458
				foreach ( (array) $value as $k => $child ) {
459
					$this->cast_and_filter_item( $children, $type['children'], $k, $child, array(), $for_output );
460
				}
461
				$return[$key] = (array) $children;
462
				break;
463
			}
464
465
			$return[$key] = (array) $value;
466
			break;
@@ 496-503 (lines=8) @@
493
				}
494
			}
495
496
			if ( isset( $type['children'] ) ) {
497
				$children = array();
498
				foreach ( (array) $value as $k => $child ) {
499
					$this->cast_and_filter_item( $children, $type['children'], $k, $child, array(), $for_output );
500
				}
501
				$return[$key] = (object) $children;
502
				break;
503
			}
504
505
			if ( isset( $type['subtype'] ) ) {
506
				return $this->cast_and_filter_item( $return, $type['subtype'], $key, $value, $types, $for_output );