Code Duplication    Length = 8-9 lines in 3 locations

class.json-api-endpoints.php 3 locations

@@ 495-503 (lines=9) @@
492
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
493
			break;
494
		case 'post_reference' :
495
		case 'comment_reference' :
496
			$docs = array(
497
				'ID'    => '(int)',
498
				'type'  => '(string)',
499
				'title' => '(string)',
500
				'link'  => '(URL)',
501
			);
502
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
503
			break;
504
		case 'geo' :
505
			$docs = array(
506
				'latitude'  => '(float)',
@@ 504-511 (lines=8) @@
501
			);
502
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
503
			break;
504
		case 'geo' :
505
			$docs = array(
506
				'latitude'  => '(float)',
507
				'longitude' => '(float)',
508
				'address'   => '(string)',
509
			);
510
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
511
			break;
512
		case 'author' :
513
			$docs = array(
514
				'ID'             => '(int)',
@@ 530-537 (lines=8) @@
527
			);
528
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
529
			break;
530
		case 'role' :
531
			$docs = array(
532
				'name'         => '(string)',
533
				'display_name' => '(string)',
534
				'capabilities' => '(object:boolean)',
535
			);
536
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
537
			break;
538
		case 'attachment' :
539
			$docs = array(
540
				'ID'        => '(int)',