Completed
Push — locale-in-url ( 6d9eda...81052c )
by Kamil
57:16 queued 38:25
created

MySqlDriver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A connect() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Tests\Driver;
13
14
use Doctrine\DBAL\Driver\PDOMySql\Driver;
15
16
final class MySqlDriver extends Driver
17
{
18
    /**
19
     * @var Driver
20
     */
21
    private static $connection;
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
27
    {
28
        if (null === self::$connection) {
29
            self::$connection = parent::connect($params, $username, $password, $driverOptions);
0 ignored issues
show
Documentation Bug introduced by
It seems like parent::connect($params,...ssword, $driverOptions) of type object<Doctrine\DBAL\Driver\Connection> is incompatible with the declared type object<Doctrine\DBAL\Driver\PDOMySql\Driver> of property $connection.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
30
        }
31
32
        return self::$connection;
33
    }
34
}
35