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.

ReleaseCounter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 5
c 0
b 0
f 0
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCreateDate() 0 3 1
A execute() 0 4 1
A getId() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace MyMigrations;
4
5
use Gruberro\MongoDbMigrations;
6
use MongoDB;
7
8
class ReleaseCounter implements MongoDbMigrations\MigrationInterface, MongoDbMigrations\RunAlwaysMigrationInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function getId(): string
14
    {
15
        return 'release-counter';
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function getCreateDate(): \DateTime
22
    {
23
        return new \DateTime('2016-01-01 00:00:00');
24
    }
25
26
    /**
27
     * Create one record per release
28
     *
29
     * {@inheritdoc}
30
     */
31
    public function execute(MongoDB\Database $db)
32
    {
33
        $releaseCollection = $db->selectCollection('releases');
34
        $releaseCollection->insertOne(['created' => new MongoDB\BSON\UTCDatetime((new \DateTime())->getTimestamp() * 1000)]);
35
    }
36
}
37