Code Duplication    Length = 8-9 lines in 3 locations

class.json-api-endpoints.php 3 locations

@@ 528-536 (lines=9) @@
525
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
526
			break;
527
		case 'post_reference' :
528
		case 'comment_reference' :
529
			$docs = array(
530
				'ID'    => '(int)',
531
				'type'  => '(string)',
532
				'title' => '(string)',
533
				'link'  => '(URL)',
534
			);
535
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
536
			break;
537
		case 'geo' :
538
			$docs = array(
539
				'latitude'  => '(float)',
@@ 537-544 (lines=8) @@
534
			);
535
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
536
			break;
537
		case 'geo' :
538
			$docs = array(
539
				'latitude'  => '(float)',
540
				'longitude' => '(float)',
541
				'address'   => '(string)',
542
			);
543
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
544
			break;
545
		case 'author' :
546
			$docs = array(
547
				'ID'             => '(int)',
@@ 564-571 (lines=8) @@
561
			);
562
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
563
			break;
564
		case 'role' :
565
			$docs = array(
566
				'name'         => '(string)',
567
				'display_name' => '(string)',
568
				'capabilities' => '(object:boolean)',
569
			);
570
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
571
			break;
572
		case 'attachment' :
573
			$docs = array(
574
				'ID'        => '(int)',