EventTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 12 1
1
<?php
2
3
namespace MS\Sentry\Monitor\Migration;
4
5
use Doctrine\DBAL\Connection;
6
7
class EventTable
8
{
9
    /**
10
     * @var Connection
11
     */
12
    private $connection;
13
14
    /**
15
     * @param Connection $connection
16
     */
17
    public function __construct(Connection $connection)
18
    {
19
        $this->connection = $connection;
20
    }
21
22
    /**
23
     */
24
    public function create()
25
    {
26
        $createTableSql = 'CREATE TABLE IF NOT EXISTS events (
27
            organisation TEXT,
28
            project TEXT,
29
            event_id INTEGER,
30
            created TEXT,
31
            UNIQUE(organisation, project, event_id, created)
32
        )';
33
34
        $this->connection->executeQuery($createTableSql);
35
    }
36
}
37