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

PgSqlDriver::connect()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 4
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\PDOPgSql\Driver;
15
16
final class PgSqlDriver 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\PDOPgSql\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