1 | <?php |
||
16 | class FilteringStatementGrouper implements StatementGrouper { |
||
17 | |||
18 | /** |
||
19 | * @var StatementFilter[] An associative array, mapping statement group identifiers to filters. |
||
20 | */ |
||
21 | private $filters = array(); |
||
22 | |||
23 | /** |
||
24 | * @var string[] |
||
25 | */ |
||
26 | private $groupIdentifiers = array(); |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $defaultGroupIdentifier = null; |
||
32 | |||
33 | /** |
||
34 | * @see StatementFilter |
||
35 | * |
||
36 | * @param array $filters An associative array, mapping statement group identifiers to either |
||
37 | * StatementFilter objects, or to null for the default group. |
||
38 | * |
||
39 | * @throws InvalidArgumentException |
||
40 | */ |
||
41 | public function __construct( array $filters ) { |
||
56 | |||
57 | /** |
||
58 | * @param string $key |
||
59 | */ |
||
60 | private function setGroupIdentifier( $key ) { |
||
63 | |||
64 | /** |
||
65 | * @param string $key |
||
66 | * |
||
67 | * @throws InvalidArgumentException |
||
68 | */ |
||
69 | private function setDefaultGroupIdentifier( $key ) { |
||
76 | |||
77 | private function initializeDefaultGroup() { |
||
83 | |||
84 | /** |
||
85 | * @param StatementList $statements |
||
86 | * |
||
87 | * @return StatementList[] An associative array, mapping statement group identifiers to |
||
88 | * StatementList objects. All identifiers given in the constructor are guaranteed to be in the |
||
89 | * result. |
||
90 | */ |
||
91 | public function groupStatements( StatementList $statements ) { |
||
101 | |||
102 | /** |
||
103 | * @return StatementList[] |
||
104 | */ |
||
105 | private function getEmptyGroups() { |
||
114 | |||
115 | /** |
||
116 | * @param Statement $statement |
||
117 | * |
||
118 | * @return string Statement group identifier |
||
119 | */ |
||
120 | private function getKey( Statement $statement ) { |
||
129 | |||
130 | } |
||
131 |