SphinxPDOConnection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 26
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildDSNString() 0 7 2
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 4/5/15
5
 * Time: 12:31 PM
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace NilPortugues\Cache\Adapter\SQL\Connection;
12
13
/**
14
 * Class SphinxPDOConnection
15
 * @package NilPortugues\Cache\Adapter\SQL\Connection
16
 */
17
class SphinxPDOConnection extends AbstractPDOConnection
18
{
19
    /**
20
     * @var array
21
     */
22
    protected $keys = [
23
        self::HOST,
24
        self::PORT,
25
    ];
26
    /**
27
     * @var string
28
     */
29
    protected $dsn = 'mysql:';
30
    /**
31
     * @param array $parameters
32
     *
33
     * @return string
34
     */
35
    protected function buildDSNString(array &$parameters)
36
    {
37
        if (\array_key_exists(self::UNIX_SOCKET, $parameters)) {
38
            return self::UNIX_SOCKET."=".$parameters[self::UNIX_SOCKET];
39
        }
40
        return parent::buildDSNString($parameters);
41
    }
42
}
43