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

Aperta
#236 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
php
Ambito
databases

Direzione di ricerca

Review PR #235 and the existing AbstractAnonymizer constructor and Context implementation first. Follow the related @todo, #[\Deprecated], and trigger_deprecation() markers; done means the constructor accepts Options and Context and the backward-compatibility layer is removed for the 3.0 path.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

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 #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:

  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.
Lingua principale
PHP
Stelle
235
Fork
17
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di makinacorpus/DbToolsBundle

Tutte le issue di makinacorpus/DbToolsBundle

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.