Completed
Push — develop ( 195cb3...f65bd6 )
by David
02:59
created

Wordlift_Relation_Rebuild_Adapter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A process_all() 0 11 1
1
<?php
2
3
class Wordlift_Relation_Rebuild_Adapter {
4
	/**
5
	 * @var Wordlift_Relation_Rebuild_Service
6
	 */
7
	private $relation_rebuild_service;
8
9
10
	/**
11
	 * Wordlift_Relation_Rebuild_Adapter constructor.
12
	 *
13
	 * @param \Wordlift_Relation_Rebuild_Service $relation_rebuild_service
14
	 */
15
	public function __construct( $relation_rebuild_service ) {
16
		$this->relation_rebuild_service = $relation_rebuild_service;
17
	}
18
19
	public function process_all() {
20
21
		$this->relation_rebuild_service->process_all();
22
23
		ob_clean();
24
25
		wp_send_json_success( array(
26
			'count' => $this->relation_rebuild_service->get_count(),
27
		) );
28
29
	}
30
31
}
32