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

ReleaseCounter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 29
rs 10

3 Methods

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