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

DriverAdapterFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 15
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createDriverAdapter() 0 5 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