Capsule5Adapter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 39
c 0
b 0
f 0
wmc 2
lcom 0
cbo 4
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getConnection() 0 4 1
1
<?php
2
3
namespace Soluble\DbWrapper\Adapter\Laravel;
4
5
use Soluble\DbWrapper\Adapter\AdapterInterface;
6
use Soluble\DbWrapper\Connection\Laravel\Capsule5Connection;
7
use Soluble\DbWrapper\Adapter\Pdo\GenericPdo;
8
9
class Capsule5Adapter extends GenericPdo implements AdapterInterface
10
{
11
    /**
12
     * @var \Illuminate\Database\Capsule\Manager
13
     */
14
    protected $capsule;
15
16
    /**
17
     * @var Capsule5Connection
18
     */
19
    protected $connection;
20
21
    /**
22
     * @var \PDO
23
     */
24
    protected $resource;
25
26
    /**
27
     * Constructor.
28
     *
29
     * @param \Illuminate\Database\Capsule\Manager $capsule
30
     */
31 6
    public function __construct(\Illuminate\Database\Capsule\Manager $capsule)
32
    {
33 6
        $this->capsule = $capsule;
34 6
        $this->connection = new Capsule5Connection($this, $capsule);
35 6
        $this->resource = $capsule->getConnection()->getPdo();
36 6
    }
37
38
    /**
39
     * {@inheritdoc}
40
     *
41
     * @return Capsule5Connection
42
     */
43 1
    public function getConnection()
44
    {
45 1
        return $this->connection;
46
    }
47
}
48