Importer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A import() 0 12 1
1
<?php
2
3
namespace MS\Sentry\Monitor\Service\Import;
4
5
use Doctrine\DBAL\Connection;
6
7
class Importer
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
     * @param string $organisation
24
     * @param string $project
25
     * @param array  $simplifiedEvent
26
     */
27
    public function import($organisation, $project, array $simplifiedEvent)
28
    {
29
        $this->connection->executeQuery(
30
            'INSERT OR IGNORE INTO events (organisation, project, event_id, created) VALUES(?, ?, ?, ?)',
31
            [
32
                $organisation,
33
                $project,
34
                $simplifiedEvent['id'],
35
                $simplifiedEvent['created']
36
            ]
37
        );
38
    }
39
}
40