DbConnectionFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 19
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 1
1
<?php
2
/**
3
 * @package EBloodBank
4
 * @since   1.6
5
 */
6
namespace EBloodBank;
7
8
use Doctrine\DBAL;
9
use Psr\Container\ContainerInterface;
10
11
/**
12
 * @since 1.6
13
 */
14
class DbConnectionFactory
15
{
16
    /**
17
     * @param  ContainerInterface $container
18
     * @return \Doctrine\DBAL\Connection
19
     * @since  1.6
20
     */
21
    public function __invoke(ContainerInterface $container)
22
    {
23
        $DbConnection = DBAL\DriverManager::getConnection([
24
            'dbname'    => EBB_DB_NAME,
25
            'user'      => EBB_DB_USER,
26
            'password'  => EBB_DB_PASS,
27
            'host'      => EBB_DB_HOST,
28
            'driver'    => EBB_DB_DRIVER,
29
            'charset'   => 'utf8',
30
        ]);
31
32
        return $DbConnection;
33
    }
34
}
35