Test Setup Failed
Push — master ( d6fde7...1e848b )
by Php Easy Api
04:20
created

Connector   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 33
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getConnection() 0 3 1
A setConnector() 0 5 1
1
<?php
2
3
namespace Migratio\Connector;
4
5
class Connector
6
{
7
    /**
8
     * @var $instance
0 ignored issues
show
Documentation Bug introduced by
The doc comment $instance at position 0 could not be parsed: Unknown type name '$instance' at position 0 in $instance.
Loading history...
9
     */
10
    protected static $instance;
11
12
    /**
13
     * @var string
14
     */
15
    protected $driver;
16
17
    /**
18
     * @var $connector
0 ignored issues
show
Documentation Bug introduced by
The doc comment $connector at position 0 could not be parsed: Unknown type name '$connector' at position 0 in $connector.
Loading history...
19
     */
20
    protected $connector;
21
22
    /**
23
     * @return mixed
24
     */
25
    public function setConnector()
26
    {
27
        $driver             = ucfirst($this->config['database']['driver']);
28
        $driverNamespace    = 'Migratio\\Connector\\'.$driver.'';
29
        $this->connector    = new $driverNamespace($this->config['database']);
30
    }
31
32
    /**
33
     * @return mixed
34
     */
35
    public function getConnection()
36
    {
37
        return $this->connector;
38
    }
39
}
40