Completed
Push — master ( 240a65...f42128 )
by James Ekow Abaka
02:20
created

DriverFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createDriver() 0 5 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: ekow
5
 * Date: 9/4/17
6
 * Time: 10:50 AM
7
 */
8
9
namespace ntentan\atiaa;
10
11
use ntentan\utils\Text;
12
13
14
class DriverFactory
15
{
16
    private $config;
17
18
    public function __construct(array $config)
19
    {
20
        $this->config = $config;
21
    }
22
23
    public function createDriver()
24
    {
25
        $classname = '\ntentan\atiaa\drivers\\' . Text::ucamelize($this->config['driver']) . "Driver";
26
        return new $classname($this->config);
27
    }
28
}