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.

MessagesSchema   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 88.46%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 47
ccs 23
cts 26
cp 0.8846
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 5 1
A createQueueTable() 0 6 1
A createMessagesTable() 0 16 1
1
<?php
2
3
namespace Bernard\Driver\Doctrine;
4
5
use Doctrine\DBAL\Schema\Schema;
6
7
class MessagesSchema
8
{
9
    /**
10
     * Creates tables on the current schema given.
11
     *
12
     * @param Schema $schema
13
     */
14 8
    public static function create(Schema $schema)
15
    {
16 8
        static::createQueueTable($schema);
17 8
        static::createMessagesTable($schema);
18 8
    }
19
20
    /**
21
     * Creates queue table on the current schema given.
22
     *
23
     * @param Schema $schema
24
     */
25 8
    protected static function createQueueTable(Schema $schema)
26
    {
27 8
        $table = $schema->createTable('bernard_queues');
28 8
        $table->addColumn('name', 'string');
29 8
        $table->setPrimaryKey(['name']);
30 8
    }
31
32
    /**
33
     * Creates message table on the current schema given.
34
     *
35
     * @param Schema $schema
36
     */
37 8
    protected static function createMessagesTable(Schema $schema)
38
    {
39 8
        $table = $schema->createTable('bernard_messages');
40 8
        $table->addColumn('id', 'integer', [
41 8
            'autoincrement' => true,
42 8
            'unsigned' => true,
43 8
            'notnull' => true,
44 8
        ]);
45
46 8
        $table->addColumn('queue', 'string');
47 8
        $table->addColumn('message', 'text');
48 8
        $table->addColumn('visible', 'boolean', ['default' => true]);
49 8
        $table->addColumn('sentAt', 'datetime');
50 8
        $table->setPrimaryKey(['id']);
51 8
        $table->addIndex(['queue', 'sentAt', 'visible']);
52 8
    }
53
}
54