Code Duplication    Length = 8-10 lines in 2 locations

src/wordlift/vocabulary/api/class-entity-rest-endpoint.php 2 locations

@@ 38-47 (lines=10) @@
35
	}
36
37
38
	public function accept_entity( $request ) {
39
		$data        = $request->get_params();
40
		$term_id     = (int) $data['term_id'];
41
		$entity_data = (array) $data['entity'];
42
		$entity      = Entity_List_Factory::get_instance( $term_id );
43
		$entity->save_jsonld_data( $entity_data );
44
		update_term_meta( $term_id, self::IGNORE_TAG_FROM_LISTING, 1 );
45
46
		return $term_id;
47
	}
48
49
	public function undo( $request ) {
50
		$data    = $request->get_params();
@@ 99-106 (lines=8) @@
96
		$this->register_entity_accept_or_reject_route( $route, array( $this, 'reject_entity' ) );
97
	}
98
99
	public function reject_entity( $request ) {
100
		$data        = $request->get_params();
101
		$term_id     = (int) $data['term_id'];
102
		$entity_data = (array) $data['entity'];
103
		$entity      = Entity_List_Factory::get_instance( $term_id );
104
		$entity->remove_entity_by_id( $entity_data['@id'] );
105
		return $term_id;
106
	}
107
108
	private function register_nomatch_route() {
109
		register_rest_route(