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

Connector::getConnection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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