Completed
Push — master ( 58c9ab...b3ba9b )
by Sébastien
19:11 queued 01:31
created

Capsule5Adapter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 4
dl 0
loc 42
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\Exception;
6
use Soluble\DbWrapper\Result\Resultset;
7
use Soluble\DbWrapper\Adapter\AdapterInterface;
8
use Soluble\DbWrapper\Connection\Laravel\Capsule5Connection;
9
use Soluble\DbWrapper\Adapter\Pdo\GenericPdo;
10
11
class Capsule5Adapter extends GenericPdo implements AdapterInterface
12
{
13
14
    /**
15
     *
16
     * @var \Illuminate\Database\Capsule\Manager
17
     */
18
    protected $capsule;
19
20
    /**
21
     *
22
     * @var Capsule5Connection
23
     */
24
    protected $connection;
25
26
    /**
27
     *
28
     * @var \PDO
29
     */
30
    protected $resource;
31
32
    /**
33
     * Constructor
34
     *
35
     * @param \Illuminate\Database\Capsule\Manager $capsule
36
     */
37
    public function __construct(\Illuminate\Database\Capsule\Manager $capsule)
38
    {
39
        $this->capsule = $capsule;
40
        $this->connection = new Capsule5Connection($this, $capsule);
41
        $this->resource = $capsule->getConnection()->getPdo();
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     * @return Capsule5Connection
47
     */
48
    public function getConnection()
49
    {
50
        return $this->connection;
51
    }
52
}
53