Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 7 |
CRAP | |
0.00% |
0 / 1 |
ProcessorGroup | |
0.00% |
0 / 8 |
|
0.00% |
0 / 7 |
72 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
add | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
afterHeaderImported | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
afterTopicImported | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
afterPostImported | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
importAborted | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
call | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace Flow\Import\Postprocessor; |
4 | |
5 | use Flow\Import\IImportHeader; |
6 | use Flow\Import\IImportPost; |
7 | use Flow\Import\IImportTopic; |
8 | use Flow\Import\PageImportState; |
9 | use Flow\Import\TopicImportState; |
10 | use Flow\Model\PostRevision; |
11 | |
12 | class ProcessorGroup implements Postprocessor { |
13 | /** @var array<Postprocessor> */ |
14 | protected $processors; |
15 | |
16 | public function __construct() { |
17 | $this->processors = []; |
18 | } |
19 | |
20 | public function add( Postprocessor $proc ) { |
21 | $this->processors[] = $proc; |
22 | } |
23 | |
24 | public function afterHeaderImported( PageImportState $state, IImportHeader $header ) { |
25 | $this->call( __FUNCTION__, func_get_args() ); |
26 | } |
27 | |
28 | public function afterTopicImported( TopicImportState $state, IImportTopic $topic ) { |
29 | $this->call( __FUNCTION__, func_get_args() ); |
30 | } |
31 | |
32 | public function afterPostImported( TopicImportState $state, IImportPost $post, PostRevision $newPost ) { |
33 | $this->call( __FUNCTION__, func_get_args() ); |
34 | } |
35 | |
36 | public function importAborted() { |
37 | $this->call( __FUNCTION__, func_get_args() ); |
38 | } |
39 | |
40 | protected function call( $name, $args ) { |
41 | foreach ( $this->processors as $proc ) { |
42 | $proc->$name( ...$args ); |
43 | } |
44 | } |
45 | } |