Code Duplication    Length = 8-9 lines in 3 locations

class.json-api-endpoints.php 3 locations

@@ 507-515 (lines=9) @@
504
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
505
			break;
506
		case 'post_reference' :
507
		case 'comment_reference' :
508
			$docs = array(
509
				'ID'    => '(int)',
510
				'type'  => '(string)',
511
				'title' => '(string)',
512
				'link'  => '(URL)',
513
			);
514
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
515
			break;
516
		case 'geo' :
517
			$docs = array(
518
				'latitude'  => '(float)',
@@ 516-523 (lines=8) @@
513
			);
514
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
515
			break;
516
		case 'geo' :
517
			$docs = array(
518
				'latitude'  => '(float)',
519
				'longitude' => '(float)',
520
				'address'   => '(string)',
521
			);
522
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
523
			break;
524
		case 'author' :
525
			$docs = array(
526
				'ID'             => '(int)',
@@ 542-549 (lines=8) @@
539
			);
540
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
541
			break;
542
		case 'role' :
543
			$docs = array(
544
				'name'         => '(string)',
545
				'display_name' => '(string)',
546
				'capabilities' => '(object:boolean)',
547
			);
548
			$return[$key] = (object) $this->cast_and_filter( $value, $docs, false, $for_output );
549
			break;
550
		case 'attachment' :
551
			$docs = array(
552
				'ID'        => '(int)',