Completed
Pull Request — master (#13)
by Jeroen De
03:37
created

ModernTimelinePrinter::setRecursiveTextProcessor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 2
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace ModernTimeline;
6
7
use ParamProcessor\ProcessedParam;
8
use SMW\Parser\RecursiveTextProcessor;
9
use SMW\Query\ResultPrinter;
10
use SMWQuery;
11
use SMWQueryResult;
12
13
class ModernTimelinePrinter implements ResultPrinter {
14
15
	public function getName(): string {
16
		return wfMessage( 'modern-timeline-format-name' )->text();
17
	}
18
19 5
	public function getParamDefinitions( array $definitions ) {
20 5
		return array_merge( $definitions, TimelineOptions::getTimelineParameterDefinitions() );
21
	}
22
23
	/**
24
	 * @param SMWQueryResult $result
25
	 * @param ProcessedParam[] $parameters Note: currently getting Param[] from SMW but lets pretend the legacy refactor happened already
26
	 * @param int $outputMode
27
	 *
28
	 * @return string
29
	 */
30 4
	public function getResult( SMWQueryResult $result, array $parameters, $outputMode ): string {
31 4
		return ( new TimelinePresenter( $parameters ) )->getResult( $result );
32
	}
33
34 4
	public function getQueryMode( $context ): int {
35 4
		return SMWQuery::MODE_INSTANCES;
36
	}
37
38
	public function setShowErrors( $show ) {
39
	}
40
41
	public function isExportFormat(): bool {
42
		return false;
43
	}
44
45 4
	public function getDefaultSort(): string {
46 4
		return 'ASC';
47
	}
48
49 4
	public function isDeferrable(): bool {
50 4
		return false;
51
	}
52
53 1
	public function supportsRecursiveAnnotation(): bool {
54 1
		return false;
55
	}
56
57 5
	public function setRecursiveTextProcessor( RecursiveTextProcessor $recursiveTextProcessor ) {
58
	}
59
}