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::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1.008

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 5
cp 0.8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1.008
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