Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 1 | public function groupStatements( StatementList $statements ) { |
|
22 | /** @var StatementList[] $groups */ |
||
23 | 1 | $groups = []; |
|
24 | |||
25 | 1 | foreach ( $statements->toArray() as $statement ) { |
|
26 | 1 | $id = $statement->getPropertyId()->getSerialization(); |
|
27 | |||
28 | 1 | if ( !isset( $groups[$id] ) ) { |
|
29 | 1 | $groups[$id] = new StatementList(); |
|
30 | 1 | } |
|
31 | |||
32 | 1 | $groups[$id]->addStatement( $statement ); |
|
33 | 1 | } |
|
34 | |||
35 | 1 | return $groups; |
|
36 | } |
||
39 |