Code Duplication    Length = 8-8 lines in 2 locations

class.json-api-endpoints.php 2 locations

@@ 430-437 (lines=8) @@
427
				}
428
			}
429
430
			if ( isset( $type['children'] ) ) {
431
				$children = array();
432
				foreach ( (array) $value as $k => $child ) {
433
					$this->cast_and_filter_item( $children, $type['children'], $k, $child, array(), $for_output );
434
				}
435
				$return[$key] = (array) $children;
436
				break;
437
			}
438
439
			$return[$key] = (array) $value;
440
			break;
@@ 470-477 (lines=8) @@
467
				}
468
			}
469
470
			if ( isset( $type['children'] ) ) {
471
				$children = array();
472
				foreach ( (array) $value as $k => $child ) {
473
					$this->cast_and_filter_item( $children, $type['children'], $k, $child, array(), $for_output );
474
				}
475
				$return[$key] = (object) $children;
476
				break;
477
			}
478
479
			if ( isset( $type['subtype'] ) ) {
480
				return $this->cast_and_filter_item( $return, $type['subtype'], $key, $value, $types, $for_output );