Importer::import()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 3
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