DbalLoader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A load() 0 4 1
1
<?php
2
3
namespace Extraload\Loader\Doctrine;
4
5
use Extraload\Loader\LoaderInterface;
6
use Extraload\Loader\AutoFlushLoader;
7
use Doctrine\DBAL\Connection;
8
9
class DbalLoader extends AutoFlushLoader implements LoaderInterface
10
{
11
    private $connection;
12
    private $tableName;
13
14
    public function __construct(Connection $connection, $tableName)
15
    {
16
        $this->connection = $connection;
17
        $this->tableName = $tableName;
18
    }
19
20
    public function load($data)
21
    {
22
        return $this->connection->insert($this->tableName, $data);
23
    }
24
}
25