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

DriverFactory::createDriver()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
crap 2
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
}