Commit 34c4ddec authored by Alessandro Minoccheri's avatar Alessandro Minoccheri

use newer PHP syntax

parent 436179f0
......@@ -108,8 +108,8 @@ abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDri
}
$majorVersion = $versionParts['major'];
$minorVersion = isset($versionParts['minor']) ? $versionParts['minor'] : 0;
$patchVersion = isset($versionParts['patch']) ? $versionParts['patch'] : 0;
$minorVersion = $versionParts['minor'] ?? 0;
$patchVersion = $versionParts['patch'] ?? 0;
$version = $majorVersion . '.' . $minorVersion . '.' . $patchVersion;
switch(true) {
......
......@@ -325,7 +325,7 @@ class QueryBuilder
*/
public function getParameter($key)
{
return isset($this->params[$key]) ? $this->params[$key] : null;
return $this->params[$key] ?? null;
}
/**
......@@ -347,7 +347,7 @@ class QueryBuilder
*/
public function getParameterType($key)
{
return isset($this->paramTypes[$key]) ? $this->paramTypes[$key] : null;
return $this->paramTypes[$key] ?? null;
}
/**
......
......@@ -151,7 +151,7 @@ class PoolingShardConnection extends Connection
{
$params = $this->getParams();
return isset($params['host']) ? $params['host'] : parent::getHost();
return $params['host'] ?? parent::getHost();
}
/**
......@@ -161,7 +161,7 @@ class PoolingShardConnection extends Connection
{
$params = $this->getParams();
return isset($params['port']) ? $params['port'] : parent::getPort();
return $params['port'] ?? parent::getPort();
}
/**
......@@ -171,7 +171,7 @@ class PoolingShardConnection extends Connection
{
$params = $this->getParams();
return isset($params['user']) ? $params['user'] : parent::getUsername();
return $params['user'] ?? parent::getUsername();
}
/**
......@@ -181,7 +181,7 @@ class PoolingShardConnection extends Connection
{
$params = $this->getParams();
return isset($params['password']) ? $params['password'] : parent::getPassword();
return $params['password'] ?? parent::getPassword();
}
/**
......
......@@ -29,8 +29,8 @@ abstract class AbstractDriverTest extends DbalFunctionalTestCase
$params = $this->_conn->getParams();
unset($params['dbname']);
$user = isset($params['user']) ? $params['user'] : null;
$password = isset($params['password']) ? $params['password'] : null;
$user = $params['user'] ?? null;
$password = $params['password'] ?? null;
$connection = $this->driver->connect($params, $user, $password);
......
......@@ -66,8 +66,8 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$params['dbname'] = 'test_drop_database';
}
$user = isset($params['user']) ? $params['user'] : null;
$password = isset($params['password']) ? $params['password'] : null;
$user = $params['user'] ?? null;
$password = $params['password'] ?? null;
$connection = $this->_conn->getDriver()->connect($params, $user, $password);
......
......@@ -39,8 +39,8 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
$params = $this->_conn->getParams();
$params['dbname'] = 'test_drop_database';
$user = isset($params['user']) ? $params['user'] : null;
$password = isset($params['password']) ? $params['password'] : null;
$user = $params['user'] ?? null;
$password = $params['password'] ?? null;
$connection = $this->_conn->getDriver()->connect($params, $user, $password);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment