CompositeReporter::started()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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