NullStatementGrouper::groupStatements()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Wikibase\DataModel\Services\Statement\Grouper;
4
5
use Wikibase\DataModel\Statement\StatementList;
6
7
/**
8
 * An unconditional statement grouper that always returns a single group, containing the original,
9
 * unmodified list of statements, and nothing else.
10
 *
11
 * @since 3.2
12
 *
13
 * @license GPL-2.0-or-later
14
 * @author Thiemo Kreuz
15
 */
16
class NullStatementGrouper implements StatementGrouper {
17
18
	/**
19
	 * @param StatementList $statements
20
	 *
21 1
	 * @return StatementList[] An associative array, mapping the default group identifier
22 1
	 *  "statements" to the unmodified StatementList object.
23
	 */
24
	public function groupStatements( StatementList $statements ) {
25
		return [ 'statements' => $statements ];
26
	}
27
28
}
29