| Total Complexity | 4 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 8 | class ObfuscateProductionEmailAddresses implements MongoDbMigrations\MigrationInterface, MongoDbMigrations\ContextualMigrationInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * {@inheritdoc} |
||
| 12 | */ |
||
| 13 | public function getId(): string |
||
| 14 | { |
||
| 15 | return 'obfuscate-production-email-addresses'; |
||
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * {@inheritdoc} |
||
| 20 | */ |
||
| 21 | public function getCreateDate(): \DateTime |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * The obfuscation is relevant for both development and staging |
||
| 28 | * |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | public function getContexts(): array |
||
| 32 | { |
||
| 33 | return ['development', 'staging']; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Obfuscate all email addresses |
||
| 38 | * |
||
| 39 | * In case a production backup is restored, all email addresses are going to be obfuscated. |
||
| 40 | * |
||
| 41 | * {@inheritdoc} |
||
| 42 | */ |
||
| 43 | public function execute(Database $db) |
||
| 47 | } |
||
| 48 | } |
||
| 49 |