Code Duplication    Length = 8-9 lines in 3 locations

class.json-api-endpoints.php 3 locations

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