GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ConnectionAdapter::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 2
nc 2
nop 4
1
<?php declare(strict_types=1);
2
/**
3
 * @license MIT
4
 * @author Samuel Adeshina <[email protected](clent, data)om>
5
 *
6
 * This file is part of the EmmetBlue project, please read the license document
7
 * available in the root level of the project
8
 */
9
namespace EmmetBlue\Core\Connection;
10
11
/**
12
 * class ConnectionAdapter.
13
 * Instantiates a new instance of ConnectableInterface
14
 *
15
 * @author Samuel Adeshina <[email protected]>
16
 *
17
 * @since v0.0.1 08/06/2016 14:20
18
 */
19
class ConnectionAdapter
20
{
21
	public $connection;
22
23
    public function __construct(string $adapter, array $dsnArray, string $username=null, string $password=null)
24
    {
25
    	$class = __NAMESPACE__."\\Adapters\\$adapter";
26
    	$adapterObject = new $class;
27
28
    	if ($adapterObject instanceof ConnectableInterface)
29
    	{
30
    		$adapterObject->setDsn($dsnArray);
31
	    	$adapterObject->connect($username, $password);
32
    	}
33
34
    	$this->connection = $adapterObject->getConnection();
35
    }
36
37
    public function getConnection() : \PDO
38
    {
39
    	return $this->connection;
40
    }
41
}