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

CreateUserCollection::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
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 CreateUserCollection implements MongoDbMigrations\MigrationInterface
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public function getId()
13
    {
14
        return 'create-user-collection-and-its-indexes';
15
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function getCreateDate()
21
    {
22
        return new \DateTime('2016-02-25 16:30:00');
23
    }
24
25
    /**
26
     * Creates a user collection and it's indexes
27
     *
28
     * This migration creates the required user collection to establish an application login and it's required indexes.
29
     * An overall admin user is created as well.
30
     *
31
     * {@inheritdoc}
32
     */
33
    public function execute(\MongoDB $db)
34
    {
35
        $userCollection = $db->selectCollection('user');
36
37
        $userCollection->createIndex(['email_address' => true], ['unique' => true]);
38
39
        $userCollection->insert(['username' => 'admin', 'password' => password_hash('topsecret', PASSWORD_DEFAULT), 'email_address' => '[email protected]']);
40
    }
41
}
42