Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/php-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"

services:
memcached:
Expand Down
6 changes: 3 additions & 3 deletions src/DalResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class DalResolver implements IConnectionResolver
const MODE_WRITE = 'w';

public function __construct(
ConfigProviderInterface $connectionConfig = null,
ConfigProviderInterface $datastoreConfig = null,
ConfigProviderInterface $dalConfig = null
?ConfigProviderInterface $connectionConfig = null,
?ConfigProviderInterface $datastoreConfig = null,
?ConfigProviderInterface $dalConfig = null
)
{
if($connectionConfig !== null)
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/Connection/CqlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class CqlException extends ConnectionException
{
public function __construct($msg = "", $code = 0, \Exception $previous = null)
public function __construct($msg = "", $code = 0, ?\Exception $previous = null)
{
if($previous !== null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Foundation/AbstractSanitizableDao.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function validateDaoProperty(
* @throws \Exception
* @throws mixed
*/
public function isValid(array $properties = null, $throw = false)
public function isValid(?array $properties = null, $throw = false)
{
$isValid = true;
if($properties === null)
Expand Down
2 changes: 1 addition & 1 deletion src/ISanitizableDao.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function validateDaoProperty(
* @throws \Exception
* @throws mixed
*/
public function isValid(array $properties = null, $throw = false);
public function isValid(?array $properties = null, $throw = false);

/**
* Serialize a value based on the rules of a property
Expand Down
8 changes: 4 additions & 4 deletions src/Ql/AbstractQlConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function switchDatabase($db)
}
}

abstract protected function _runQuery($query, array $values = null);
abstract protected function _runQuery($query, ?array $values = null);

/**
* Execute a query
Expand All @@ -134,7 +134,7 @@ abstract protected function _runQuery($query, array $values = null);
*
* @throws ConnectionException
*/
public function runQuery($query, array $values = null)
public function runQuery($query, ?array $values = null)
{
$perfId = $this->getResolver()->startPerformanceMetric(
$this,
Expand All @@ -155,7 +155,7 @@ function () use ($query) {
return $result;
}

abstract protected function _fetchQueryResults($query, array $values = null);
abstract protected function _fetchQueryResults($query, ?array $values = null);

/**
* Fetch the results of the query
Expand All @@ -167,7 +167,7 @@ abstract protected function _fetchQueryResults($query, array $values = null);
*
* @throws ConnectionException
*/
public function fetchQueryResults($query, array $values = null)
public function fetchQueryResults($query, ?array $values = null)
{
$perfId = $this->getResolver()->startPerformanceMetric(
$this,
Expand Down
6 changes: 3 additions & 3 deletions src/Ql/Cql/CqlConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ protected function _setKeyspace($keyspace, $force = false)
* @throws \Exception
* @throws \Packaged\Dal\Exceptions\DalException
*/
public function runQuery($query, array $values = null)
public function runQuery($query, ?array $values = null)
{
$this->_prepareAndExecute(
DalResolver::MODE_WRITE,
Expand All @@ -366,7 +366,7 @@ public function runQuery($query, array $values = null)
* @throws \Exception
* @throws \Packaged\Dal\Exceptions\DalException
*/
public function fetchQueryResults($query, array $values = null)
public function fetchQueryResults($query, ?array $values = null)
{
return $this->_prepareAndExecute(
DalResolver::MODE_READ,
Expand All @@ -387,7 +387,7 @@ public function fetchQueryResults($query, array $values = null)
* @throws \Exception
* @throws \Packaged\Dal\Exceptions\DalException
*/
protected function _prepareAndExecute($mode, $consistency, $query, array $values = null)
protected function _prepareAndExecute($mode, $consistency, $query, ?array $values = null)
{
$perfId = $this->getResolver()->startPerformanceMetric($this, $mode, $query);
if($values)
Expand Down
4 changes: 2 additions & 2 deletions src/Ql/IQLDataConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface IQLDataConnection extends IDataConnection
*
* @return int number of affected rows
*/
public function runQuery($query, array $values = null);
public function runQuery($query, ?array $values = null);

/**
* Fetch the results of the query
Expand All @@ -23,5 +23,5 @@ public function runQuery($query, array $values = null);
*
* @return array
*/
public function fetchQueryResults($query, array $values = null);
public function fetchQueryResults($query, ?array $values = null);
}
6 changes: 3 additions & 3 deletions src/Ql/MySQLiConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ protected function _shouldReconnectAfterException(\Exception $e)
|| ($p && in_array((string)$p->getCode(), $codes, true));
}

protected function _runQuery($query, array $values = null)
protected function _runQuery($query, ?array $values = null)
{
$stmt = $this->_executeQuery($query, $values);
$rows = $stmt->affected_rows;
$stmt->free_result();
return $rows;
}

protected function _fetchQueryResults($query, array $values = null)
protected function _fetchQueryResults($query, ?array $values = null)
{
$stmt = $this->_executeQuery($query, $values);
$result = $stmt->get_result();
Expand All @@ -208,7 +208,7 @@ protected function _fetchQueryResults($query, array $values = null)
return $rows;
}

private function _executeQuery($query, array $values = null)
private function _executeQuery($query, ?array $values = null)
{
$stmt = $this->_getStatement($query);
if($values)
Expand Down
6 changes: 3 additions & 3 deletions src/Ql/PdoConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ protected function _switchDatabase($db)
}
}

protected function _fetchQueryResults($query, array $values = null)
protected function _fetchQueryResults($query, ?array $values = null)
{
$stmt = $this->_executeQuery($query, $values);
$rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);
$stmt->closeCursor();
return $rows;
}

protected function _runQuery($query, array $values = null)
protected function _runQuery($query, ?array $values = null)
{
$stmt = $this->_executeQuery($query, $values);
$rows = $stmt->rowCount();
Expand Down Expand Up @@ -271,7 +271,7 @@ protected function _shouldReconnectAfterException(\Exception $e)
|| ($p && in_array((string)$p->getCode(), $codes, true));
}

private function _executeQuery($query, array $values = null)
private function _executeQuery($query, ?array $values = null)
{
$stmt = $this->_getStatement($query);
if($values)
Expand Down
2 changes: 1 addition & 1 deletion tests/Ql/Cql/CqlQueryObserverConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function getQueries()
return $this->_queryLog;
}

public function runQuery($query, array $values = null)
public function runQuery($query, ?array $values = null)
{
$this->_queryLog[] = ['runQuery', $query, $values];
return parent::runQuery($query, $values);
Expand Down
4 changes: 2 additions & 2 deletions tests/Ql/Mocks/MockAbstractQlDataConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public function getExecutedQueryValues()
return $this->_values;
}

public function runQuery($query, array $values = null)
public function runQuery($query, ?array $values = null)
{
$this->_query = $query;
$this->_values = $values;
return $this->_runResult;
}

public function fetchQueryResults($query, array $values = null)
public function fetchQueryResults($query, ?array $values = null)
{
$this->runQuery($query, $values);
return $this->_fetchResult;
Expand Down