@@ -34,6 +34,7 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * ->reKey allows you to reorganise the keys if they may be out of order as when we write to csv we do it in the order given |
36 | 36 | * e.g. if you build up an array, adding new columns/keys as you go down the multi levels, so long as you push them into the keys passed here or leave blank and use the first row |
37 | + * @param string[] $keys |
|
37 | 38 | */ |
38 | 39 | public function reKey($keys = null) |
39 | 40 | { |
@@ -71,11 +72,17 @@ discard block |
||
71 | 72 | } |
72 | 73 | } |
73 | 74 | |
75 | + /** |
|
76 | + * @param \Closure $callback |
|
77 | + */ |
|
74 | 78 | public function mapRows($callback) |
75 | 79 | { |
76 | 80 | $this->data = array_map($callback, $this->data); |
77 | 81 | } |
78 | 82 | |
83 | + /** |
|
84 | + * @param \Closure $callback |
|
85 | + */ |
|
79 | 86 | public function filterRows($callback) |
80 | 87 | { |
81 | 88 | $this->data = array_filter($this->data, $callback); |
@@ -136,6 +143,9 @@ discard block |
||
136 | 143 | // TODO |
137 | 144 | } |
138 | 145 | |
146 | + /** |
|
147 | + * @param string $column |
|
148 | + */ |
|
139 | 149 | public function removeDuplicates($column) |
140 | 150 | { |
141 | 151 | $index = array(); |
@@ -148,6 +158,9 @@ discard block |
||
148 | 158 | }); |
149 | 159 | } |
150 | 160 | |
161 | + /** |
|
162 | + * @param string $column |
|
163 | + */ |
|
151 | 164 | public function removeBlanks($column) |
152 | 165 | { |
153 | 166 | $this->filterRows(function ($row) use ($column) { |