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.

CreateUserCollection::getId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
namespace MyMigrations;
4
5
use Gruberro\MongoDbMigrations;
6
use MongoDB\Database;
7
8
class CreateUserCollection implements MongoDbMigrations\MigrationInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function getId(): string
14
    {
15
        return 'create-user-collection-and-its-indexes';
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function getCreateDate(): \DateTime
22
    {
23
        return new \DateTime('2016-02-25 16:30:00');
24
    }
25
26
    /**
27
     * Creates a user collection and it's indexes
28
     *
29
     * This migration creates the required user collection to establish an application login and it's required indexes.
30
     * An overall admin user is created as well.
31
     *
32
     * {@inheritdoc}
33
     */
34
    public function execute(Database $db)
35
    {
36
        $userCollection = $db->selectCollection('user');
37
38
        $userCollection->createIndex(['email_address' => 1], ['unique' => true]);
39
40
        $userCollection->insertOne(['username' => 'admin', 'password' => password_hash('topsecret', PASSWORD_DEFAULT), 'email_address' => '[email protected]']);
41
    }
42
}
43