Code Duplication    Length = 8-9 lines in 3 locations

class.json-api-endpoints.php 3 locations

@@ 534-542 (lines=9) @@
531
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
532
			break;
533
		case 'post_reference' :
534
		case 'comment_reference' :
535
			$docs = array(
536
				'ID'    => '(int)',
537
				'type'  => '(string)',
538
				'title' => '(string)',
539
				'link'  => '(URL)',
540
			);
541
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
542
			break;
543
		case 'geo' :
544
			$docs = array(
545
				'latitude'  => '(float)',
@@ 543-550 (lines=8) @@
540
			);
541
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
542
			break;
543
		case 'geo' :
544
			$docs = array(
545
				'latitude'  => '(float)',
546
				'longitude' => '(float)',
547
				'address'   => '(string)',
548
			);
549
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
550
			break;
551
		case 'author' :
552
			$docs = array(
553
				'ID'             => '(int)',
@@ 570-577 (lines=8) @@
567
			);
568
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
569
			break;
570
		case 'role' :
571
			$docs = array(
572
				'name'         => '(string)',
573
				'display_name' => '(string)',
574
				'capabilities' => '(object:boolean)',
575
			);
576
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
577
			break;
578
		case 'attachment' :
579
			$docs = array(
580
				'ID'        => '(int)',