Code Duplication    Length = 8-8 lines in 2 locations

class.json-api-endpoints.php 2 locations

@@ 463-470 (lines=8) @@
460
				}
461
			}
462
463
			if ( isset( $type['children'] ) ) {
464
				$children = array();
465
				foreach ( (array) $value as $k => $child ) {
466
					$this->cast_and_filter_item( $children, $type['children'], $k, $child, array(), $for_output );
467
				}
468
				$return[$key] = (array) $children;
469
				break;
470
			}
471
472
			$return[$key] = (array) $value;
473
			break;
@@ 503-510 (lines=8) @@
500
				}
501
			}
502
503
			if ( isset( $type['children'] ) ) {
504
				$children = array();
505
				foreach ( (array) $value as $k => $child ) {
506
					$this->cast_and_filter_item( $children, $type['children'], $k, $child, array(), $for_output );
507
				}
508
				$return[$key] = (object) $children;
509
				break;
510
			}
511
512
			if ( isset( $type['subtype'] ) ) {
513
				return $this->cast_and_filter_item( $return, $type['subtype'], $key, $value, $types, $for_output );