CompositeReporter   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 36
ccs 0
cts 24
cp 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A started() 0 4 1
A endedSuccessfully() 0 4 1
A endedWithError() 0 4 1
A stepStarted() 0 4 1
A stepCompleted() 0 4 1
1
<?php
2
3
namespace Queryr\Replicator\Importer;
4
5
use Exception;
6
use Queryr\Replicator\Model\EntityPage;
7
8
/**
9
 * @licence GNU GPL v2+
10
 * @author Jeroen De Dauw < [email protected] >
11
 */
12
class CompositeReporter implements PageImportReporter {
13
14
	private $firstReporter;
15
	private $secondReporter;
16
17
	public function __construct( PageImportReporter $firstReporter, PageImportReporter $secondReporter ) {
18
		$this->firstReporter = $firstReporter;
19
		$this->secondReporter = $secondReporter;
20
	}
21
22
	public function started( EntityPage $entityPage ) {
23
		$this->firstReporter->started( $entityPage );
24
		$this->secondReporter->started( $entityPage );
25
	}
26
27
	public function endedSuccessfully() {
28
		$this->firstReporter->endedSuccessfully();
29
		$this->secondReporter->endedSuccessfully();
30
	}
31
32
	public function endedWithError( Exception $ex ) {
33
		$this->firstReporter->endedWithError( $ex );
34
		$this->secondReporter->endedWithError( $ex );
35
	}
36
37
	public function stepStarted( string $message ) {
38
		$this->firstReporter->stepStarted( $message );
39
		$this->secondReporter->stepStarted( $message );
40
	}
41
42
	public function stepCompleted() {
43
		$this->firstReporter->stepCompleted();
44
		$this->secondReporter->stepCompleted();
45
	}
46
47
}
48