PDO::getAdapter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 4
nc 1
nop 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
    public static function getAdapter(\PDO $pdo)
22
    {
23
        $driver = new Driver\Pdo\Pdo($pdo);
24
        $adapter = new Adapter($driver);
25
        return $adapter;
26
    }
27
}
28