PDO   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAdapter() 0 6 1
1
<?php
2
/**
3
 *  Soluble Components (http://belgattitude.github.io/solublecomponents)
4
 *
5
 *  @link      http://github.com/belgattitude/solublecomponents for the canonical source repository
6
 *  @copyright Copyright (c) 2013-2014 Sébastien Vanvelthem
7
 *  @license   https://github.com/belgattitude/solublecomponents/blob/master/LICENSE.txt MIT License
8
 */
9
namespace Soluble\Db\Compat;
10
11
use Zend\Db\Adapter\Adapter;
12
use Zend\Db\Adapter\Driver;
13
14
class PDO
15
{
16
    /**
17
     * Return a Zend\Db\Adapter\Adapter object from an existing pdo connection
18
     * @param \PDO $pdo
19
     * @return Adapter
20
     */
21 1
    public static function getAdapter(\PDO $pdo)
22
    {
23 1
        $driver = new Driver\Pdo\Pdo($pdo);
24 1
        $adapter = new Adapter($driver);
25 1
        return $adapter;
26
    }
27
}
28