PDO::getAdapter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 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