Code Duplication    Length = 8-9 lines in 3 locations

class.json-api-endpoints.php 3 locations

@@ 484-492 (lines=9) @@
481
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
482
			break;
483
		case 'post_reference' :
484
		case 'comment_reference' :
485
			$docs = array(
486
				'ID'    => '(int)',
487
				'type'  => '(string)',
488
				'title' => '(string)',
489
				'link'  => '(URL)',
490
			);
491
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
492
			break;
493
		case 'geo' :
494
			$docs = array(
495
				'latitude'  => '(float)',
@@ 493-500 (lines=8) @@
490
			);
491
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
492
			break;
493
		case 'geo' :
494
			$docs = array(
495
				'latitude'  => '(float)',
496
				'longitude' => '(float)',
497
				'address'   => '(string)',
498
			);
499
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
500
			break;
501
		case 'author' :
502
			$docs = array(
503
				'ID'             => '(int)',
@@ 519-526 (lines=8) @@
516
			);
517
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
518
			break;
519
		case 'role' :
520
			$docs = array(
521
				'name'         => '(string)',
522
				'display_name' => '(string)',
523
				'capabilities' => '(object:boolean)',
524
			);
525
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
526
			break;
527
		case 'attachment' :
528
			$docs = array(
529
				'ID'        => '(int)',