Passed
Push — master ( 7d3861...c0cfa7 )
by Radu
01:22
created

MysqlPdoDatabase::getDataSourceName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 3
1
<?php
2
namespace WebServCo\Framework\Libraries;
3
4
use WebServCo\Framework\Exceptions\DatabaseException;
5
6
final class MysqlPdoDatabase extends \WebServCo\Framework\AbstractPdoDatabase implements
7
    \WebServCo\Framework\Interfaces\DatabaseInterface
8
{
9
    use \WebServCo\Framework\Traits\MysqlDatabaseTrait;
10
11
    protected function getDataSourceName($host, $port, $dbname)
12
    {
13
        return sprintf(
14
            '%s:host=%s;port=%s;dbname=%s;charset=%s',
15
            'mysql',
16
            $host,
17
            $port,
18
            $dbname,
19
            'utf8mb4'
20
        );
21
    }
22
}
23