Skip to content

Commit 879bfef

Browse files
committed
PENDING WORK RESET ME
1 parent 18fe9d7 commit 879bfef

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/Anonymization/Anonymizer/AnonymizerRegistry.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,18 @@ private function createAnonymizerFromPack(
157157
}
158158

159159
if ($packAnonymizer instanceof PackMultipleColumnAnonymizer) {
160-
// @todo
161-
throw new \LogicException("Not implemented yet: missing arbitrary multiple column anonymizer.");
160+
return new Core\MultipleColumnAnonymizer(
161+
$config->table,
162+
$config->targetName,
163+
$databaseSession,
164+
// @todo Convert data to an array if an iterable was
165+
// here. Later, change getSample() signature of
166+
// AbstractEnumAnonymizer to accept any iterable.
167+
$options->with([
168+
'columns' => $packAnonymizer->columns,
169+
'sample' => \is_array($packAnonymizer->data) ? $packAnonymizer->data : \iterator_to_array($packAnonymizer->data),
170+
]),
171+
);
162172
}
163173

164174
if ($packAnonymizer instanceof PackEnumGeneratedAnonymizer) {

src/Anonymization/Anonymizer/Core/FileMultipleColumnAnonymizer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
character (default is ',').
3030
- 'file_skip_header': when reading any file, set this to true to skip
3131
the first line (default is false).
32+
All other options are key-value pairs, keys are column names as defined in the
33+
'columns' option, values are targetted database column names to anonymize.
3234
TXT
3335
)]
3436
class FileMultipleColumnAnonymizer extends AbstractMultipleColumnAnonymizer

src/Anonymization/Anonymizer/Core/StringPatternAnonymizer.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,10 @@ public function createAnonymizeExpression(Update $update): Expression
110110
// so we need to create as many instances as we have ranges.
111111
$childAnonymizer = $this->getAnonymizer(
112112
'integer',
113-
new Options(
114-
[
113+
new Options([
115114
'min' => $part->start,
116115
'max' => $part->stop,
117-
],
118-
)
116+
]),
119117
);
120118
\assert($childAnonymizer instanceof AbstractSingleColumnAnonymizer);
121119

0 commit comments

Comments
 (0)