Code Duplication    Length = 8-9 lines in 3 locations

class.json-api-endpoints.php 3 locations

@@ 516-524 (lines=9) @@
513
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
514
			break;
515
		case 'post_reference' :
516
		case 'comment_reference' :
517
			$docs = array(
518
				'ID'    => '(int)',
519
				'type'  => '(string)',
520
				'title' => '(string)',
521
				'link'  => '(URL)',
522
			);
523
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
524
			break;
525
		case 'geo' :
526
			$docs = array(
527
				'latitude'  => '(float)',
@@ 525-532 (lines=8) @@
522
			);
523
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
524
			break;
525
		case 'geo' :
526
			$docs = array(
527
				'latitude'  => '(float)',
528
				'longitude' => '(float)',
529
				'address'   => '(string)',
530
			);
531
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
532
			break;
533
		case 'author' :
534
			$docs = array(
535
				'ID'             => '(int)',
@@ 551-558 (lines=8) @@
548
			);
549
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
550
			break;
551
		case 'role' :
552
			$docs = array(
553
				'name'         => '(string)',
554
				'display_name' => '(string)',
555
				'capabilities' => '(object:boolean)',
556
			);
557
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
558
			break;
559
		case 'attachment' :
560
			$docs = array(
561
				'ID'        => '(int)',