Skip to content

Change AbstractAnonymizer::__construct() signature in order to finalize Context implementation properly #236

@pounard

Description

@pounard

In many occasions, we need to share context for a single anonyzation run between anonymizers:

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:

  1. Create a new Context class, which will carry all this information.
  2. Change constructor of AbstractAnonymizer in 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 both Options $options and Context $context parameters.
  • 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

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions