File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
src/Anonymization/Anonymizer Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff 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) {
Original file line number Diff line number Diff line change 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)]
3436class FileMultipleColumnAnonymizer extends AbstractMultipleColumnAnonymizer
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments