GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 474714...b3d206 )
by Robert
02:12
created

ObfuscateProductionEmailAddresses::getCreateDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace MyMigrations;
4
5
use Gruberro\MongoDbMigrations;
6
7
class ObfuscateProductionEmailAddresses implements MongoDbMigrations\MigrationInterface, MongoDbMigrations\ContextualMigrationInterface
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public function getId()
13
    {
14
        return 'migration-3';
15
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function getCreateDate()
21
    {
22
        return new \DateTime('2016-01-01 12:12:16');
23
    }
24
25
    /**
26
     * The obfuscation is relevant for both development and staging
27
     *
28
     * {@inheritdoc}
29
     */
30
    public function getContexts()
31
    {
32
        return ['development', 'staging'];
33
    }
34
35
    /**
36
     * Obfuscate all email addresses
37
     *
38
     * In case a production backup is restored, all email addresses are going to be obfuscated.
39
     *
40
     * {@inheritdoc}
41
     */
42
    public function execute(\MongoDB $db)
43
    {
44
        $userCollection = $db->selectCollection('user');
45
        $userCollection->update(['email_address' => ['$ne' => 'deleted']], ['email_address' => 'deleted'], ['multi' => true]);
46
    }
47
}
48