-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
In many occasions, we need to share context for a single anonyzation run between anonymizers:
- Global "salt" option, for hashing (actual).
- Global "base_path" option introduced in feature: file enum anonymizer, inject samples in database from a plain text or csv file #228 (not merged yet) for file loading.
- Future sample table list (in order to avoid creating and populating the same table many times when the same anonymizer with a fixed list is used more than once).
- And probably more in the future.
All this data must go directly to anonymizers, but using the Options instance is wrong:
- Even if we propagate some data into it, it is not shared (so goodbye sample table sharing).
- Adding more and more options into it makes anonymizers unable to use those options names for themselves.
The less impactful solution I found is the following:
- Create a new
Contextclass, which will carry all this information. - Change constructor of
AbstractAnonymizerin order to accept this new parameter.
The PR #235 is a working proof of concept that introduce a new Context class in a backward compatibility fashion. If this PR is accepted, in 3.0, we will need to do the following change:
- Change
AbstractAnonymizer::__construct()signature, in order to accept bothOptions $optionsandContext $contextparameters. - Remove all backward compatibility layer accordinly.
- Follow many
@todo,#[\Deprecated]and associated\trigger_deprecation()calls we left in there to indicate us the right path for removal.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request