Code Duplication    Length = 8-9 lines in 3 locations

class.json-api-endpoints.php 3 locations

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