Code Duplication    Length = 9-13 lines in 3 locations

src/wordlift/mappings/class-jsonld-converter.php 2 locations

@@ 88-96 (lines=9) @@
85
	 *
86
	 * @return array An array with the updated JSON-LD and references.
87
	 */
88
	public function wl_term_jsonld_array( $value, $term_id ) {
89
		$jsonld     = $value['jsonld'];
90
		$references = $value['references'];
91
92
		return array(
93
			'jsonld'     => $this->build_jsonld( $jsonld, $term_id, $references, self::TERM ),
94
			'references' => $references,
95
		);
96
	}
97
98
99
	/**
@@ 116-125 (lines=10) @@
113
	 *
114
	 * @return array An array with the updated JSON-LD and references.
115
	 */
116
	public function wl_post_jsonld_array( $value, $post_id ) {
117
118
		$jsonld     = $value['jsonld'];
119
		$references = $value['references'];
120
121
		return array(
122
			'jsonld'     => $this->build_jsonld( $jsonld, $post_id, $references, self::POST ),
123
			'references' => $references,
124
		);
125
	}
126
127
	/**
128
	 * Returns JSON-LD data after applying transformation functions.

src/wordlift/vocabulary/jsonld/class-post-jsonld.php 1 location

@@ 18-30 (lines=13) @@
15
		add_filter( 'wl_after_get_jsonld', array( $this, 'wl_after_get_jsonld' ), 11, 2 );
16
	}
17
18
	public function wl_post_jsonld_array($arr, $post_id){
19
20
		$jsonld     = $arr['jsonld'];
21
		$references = $arr['references'];
22
23
		$this->add_mentions($post_id, $jsonld, $references);
24
25
		return array(
26
			'jsonld'     => $jsonld,
27
			'references' => $references
28
		);
29
30
	}
31
32
	public function add_mentions( $post_id, &$jsonld, &$references ) {
33