Code Duplication    Length = 8-9 lines in 3 locations

class.json-api-endpoints.php 3 locations

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