Unverified Commit f440d92c authored by Luís Cobucci's avatar Luís Cobucci Committed by Sergei Morozov

Respect interface's return type in methods

parent ab88b960
......@@ -46,6 +46,8 @@ class ArrayStatement implements IteratorAggregate, ResultStatement
public function closeCursor()
{
unset($this->data);
return true;
}
/**
......
......@@ -8,6 +8,7 @@ use Doctrine\DBAL\ParameterType;
use stdClass;
use const DB2_AUTOCOMMIT_OFF;
use const DB2_AUTOCOMMIT_ON;
use function assert;
use function db2_autocommit;
use function db2_commit;
use function db2_conn_error;
......@@ -23,6 +24,7 @@ use function db2_rollback;
use function db2_server_info;
use function db2_stmt_errormsg;
use function func_get_args;
use function is_bool;
class DB2Connection implements Connection, ServerInfoAwareConnection
{
......@@ -140,7 +142,10 @@ class DB2Connection implements Connection, ServerInfoAwareConnection
*/
public function beginTransaction()
{
db2_autocommit($this->conn, DB2_AUTOCOMMIT_OFF);
$result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_OFF);
assert(is_bool($result));
return $result;
}
/**
......@@ -151,7 +156,11 @@ class DB2Connection implements Connection, ServerInfoAwareConnection
if (! db2_commit($this->conn)) {
throw new DB2Exception(db2_conn_errormsg($this->conn));
}
db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON);
$result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON);
assert(is_bool($result));
return $result;
}
/**
......@@ -162,7 +171,11 @@ class DB2Connection implements Connection, ServerInfoAwareConnection
if (! db2_rollback($this->conn)) {
throw new DB2Exception(db2_conn_errormsg($this->conn));
}
db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON);
$result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON);
assert(is_bool($result));
return $result;
}
/**
......
......@@ -313,6 +313,8 @@ class SQLAnywhereStatement implements IteratorAggregate, Statement
$this->defaultFetchMode = $fetchMode;
$this->defaultFetchClass = $arg2 ?: $this->defaultFetchClass;
$this->defaultFetchClassCtorArgs = $arg3 ? (array) $arg3 : $this->defaultFetchClassCtorArgs;
return true;
}
/**
......
......@@ -152,6 +152,8 @@ class SQLSrvConnection implements Connection, ServerInfoAwareConnection
if (! sqlsrv_begin_transaction($this->conn)) {
throw SQLSrvException::fromSqlSrvErrors();
}
return true;
}
/**
......@@ -162,6 +164,8 @@ class SQLSrvConnection implements Connection, ServerInfoAwareConnection
if (! sqlsrv_commit($this->conn)) {
throw SQLSrvException::fromSqlSrvErrors();
}
return true;
}
/**
......@@ -172,6 +176,8 @@ class SQLSrvConnection implements Connection, ServerInfoAwareConnection
if (! sqlsrv_rollback($this->conn)) {
throw SQLSrvException::fromSqlSrvErrors();
}
return true;
}
/**
......
......@@ -158,6 +158,8 @@ class SQLSrvStatement implements IteratorAggregate, Statement
$this->variables[$param] = $value;
$this->types[$param] = $type;
return true;
}
/**
......@@ -174,6 +176,8 @@ class SQLSrvStatement implements IteratorAggregate, Statement
// unset the statement resource if it exists as the new one will need to be bound to the new variable
$this->stmt = null;
return true;
}
/**
......@@ -263,6 +267,8 @@ class SQLSrvStatement implements IteratorAggregate, Statement
}
$this->result = true;
return true;
}
/**
......
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