SphinxPDOConnection::buildDSNString()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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