Completed
Push — master ( bf55ad...1b9783 )
by James Ekow Abaka
01:52
created

DriverAdapterFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: ekow
5
 * Date: 9/6/17
6
 * Time: 8:58 AM
7
 */
8
9
namespace ntentan\nibii;
10
11
use ntentan\utils\Text;
12
13
14
class DriverAdapterFactory implements DriverAdapterFactoryInterface
15
{
16
    private $driverName;
17
18
    public function __construct($config)
19
    {
20
        $this->driverName = $config['driver'];
21
    }
22
23
    public function createDriverAdapter()
24
    {
25
        $class = __NAMESPACE__ . '\adapters\\' . Text::ucamelize($this->driverName) . 'Adapter';
26
        return new $class();
27
    }
28
}
29