Skip to content

Commit

Permalink
Removed leading underscore from private class memeber names
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Oct 2, 2018
1 parent 64939c3 commit 1cbadb3
Show file tree
Hide file tree
Showing 18 changed files with 286 additions and 286 deletions.
132 changes: 66 additions & 66 deletions lib/Doctrine/DBAL/Connection.php

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
class DB2Connection implements Connection, ServerInfoAwareConnection
{
/** @var resource */
private $_conn = null;
private $conn = null;

/**
* @param mixed[] $params
Expand All @@ -42,11 +42,11 @@ public function __construct(array $params, $username, $password, $driverOptions
$isPersistent = (isset($params['persistent']) && $params['persistent'] === true);

if ($isPersistent) {
$this->_conn = db2_pconnect($params['dbname'], $username, $password, $driverOptions);
$this->conn = db2_pconnect($params['dbname'], $username, $password, $driverOptions);
} else {
$this->_conn = db2_connect($params['dbname'], $username, $password, $driverOptions);
$this->conn = db2_connect($params['dbname'], $username, $password, $driverOptions);
}
if (! $this->_conn) {
if (! $this->conn) {
throw new DB2Exception(db2_conn_errormsg());
}
}
Expand All @@ -57,7 +57,7 @@ public function __construct(array $params, $username, $password, $driverOptions
public function getServerVersion()
{
/** @var stdClass $serverInfo */
$serverInfo = db2_server_info($this->_conn);
$serverInfo = db2_server_info($this->conn);

return $serverInfo->DBMS_VER;
}
Expand All @@ -75,7 +75,7 @@ public function requiresQueryForServerVersion()
*/
public function prepare($sql)
{
$stmt = @db2_prepare($this->_conn, $sql);
$stmt = @db2_prepare($this->conn, $sql);
if (! $stmt) {
throw new DB2Exception(db2_stmt_errormsg());
}
Expand Down Expand Up @@ -115,7 +115,7 @@ public function quote($input, $type = ParameterType::STRING)
*/
public function exec($statement)
{
$stmt = @db2_exec($this->_conn, $statement);
$stmt = @db2_exec($this->conn, $statement);

if ($stmt === false) {
throw new DB2Exception(db2_stmt_errormsg());
Expand All @@ -129,45 +129,45 @@ public function exec($statement)
*/
public function lastInsertId($name = null)
{
return db2_last_insert_id($this->_conn);
return db2_last_insert_id($this->conn);
}

/**
* {@inheritdoc}
*/
public function beginTransaction()
{
db2_autocommit($this->_conn, DB2_AUTOCOMMIT_OFF);
db2_autocommit($this->conn, DB2_AUTOCOMMIT_OFF);
}

/**
* {@inheritdoc}
*/
public function commit()
{
if (! db2_commit($this->_conn)) {
throw new DB2Exception(db2_conn_errormsg($this->_conn));
if (! db2_commit($this->conn)) {
throw new DB2Exception(db2_conn_errormsg($this->conn));
}
db2_autocommit($this->_conn, DB2_AUTOCOMMIT_ON);
db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON);
}

/**
* {@inheritdoc}
*/
public function rollBack()
{
if (! db2_rollback($this->_conn)) {
throw new DB2Exception(db2_conn_errormsg($this->_conn));
if (! db2_rollback($this->conn)) {
throw new DB2Exception(db2_conn_errormsg($this->conn));
}
db2_autocommit($this->_conn, DB2_AUTOCOMMIT_ON);
db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON);
}

/**
* {@inheritdoc}
*/
public function errorCode()
{
return db2_conn_error($this->_conn);
return db2_conn_error($this->conn);
}

/**
Expand All @@ -176,7 +176,7 @@ public function errorCode()
public function errorInfo()
{
return [
0 => db2_conn_errormsg($this->_conn),
0 => db2_conn_errormsg($this->conn),
1 => $this->errorCode(),
];
}
Expand Down
52 changes: 26 additions & 26 deletions lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
class DB2Statement implements IteratorAggregate, Statement
{
/** @var resource */
private $_stmt;
private $stmt;

/** @var mixed[] */
private $_bindParam = [];
private $bindParam = [];

/** @var string Name of the default class to instantiate when fetching class instances. */
private $defaultFetchClass = '\stdClass';
Expand All @@ -52,7 +52,7 @@ class DB2Statement implements IteratorAggregate, Statement
private $defaultFetchClassCtorArgs = [];

/** @var int */
private $_defaultFetchMode = FetchMode::MIXED;
private $defaultFetchMode = FetchMode::MIXED;

/**
* Indicates whether the statement is in the state when fetching results is possible
Expand All @@ -66,7 +66,7 @@ class DB2Statement implements IteratorAggregate, Statement
*
* @var int[]
*/
static private $_typeMap = [
static private $typeMap = [
ParameterType::INTEGER => DB2_LONG,
ParameterType::STRING => DB2_CHAR,
];
Expand All @@ -76,7 +76,7 @@ class DB2Statement implements IteratorAggregate, Statement
*/
public function __construct($stmt)
{
$this->_stmt = $stmt;
$this->stmt = $stmt;
}

/**
Expand All @@ -92,15 +92,15 @@ public function bindValue($param, $value, $type = ParameterType::STRING)
*/
public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null)
{
$this->_bindParam[$column] =& $variable;
$this->bindParam[$column] =& $variable;

if ($type && isset(self::$_typeMap[$type])) {
$type = self::$_typeMap[$type];
if ($type && isset(self::$typeMap[$type])) {
$type = self::$typeMap[$type];
} else {
$type = DB2_CHAR;
}

if (! db2_bind_param($this->_stmt, $column, 'variable', DB2_PARAM_IN, $type)) {
if (! db2_bind_param($this->stmt, $column, 'variable', DB2_PARAM_IN, $type)) {
throw new DB2Exception(db2_stmt_errormsg());
}

Expand All @@ -112,13 +112,13 @@ public function bindParam($column, &$variable, $type = ParameterType::STRING, $l
*/
public function closeCursor()
{
if (! $this->_stmt) {
if (! $this->stmt) {
return false;
}

$this->_bindParam = [];
$this->bindParam = [];

if (! db2_free_result($this->_stmt)) {
if (! db2_free_result($this->stmt)) {
return false;
}

Expand All @@ -132,11 +132,11 @@ public function closeCursor()
*/
public function columnCount()
{
if (! $this->_stmt) {
if (! $this->stmt) {
return false;
}

return db2_num_fields($this->_stmt);
return db2_num_fields($this->stmt);
}

/**
Expand All @@ -163,21 +163,21 @@ public function errorInfo()
*/
public function execute($params = null)
{
if (! $this->_stmt) {
if (! $this->stmt) {
return false;
}

if ($params === null) {
ksort($this->_bindParam);
ksort($this->bindParam);

$params = [];

foreach ($this->_bindParam as $column => $value) {
foreach ($this->bindParam as $column => $value) {
$params[] = $value;
}
}

$retval = db2_execute($this->_stmt, $params);
$retval = db2_execute($this->stmt, $params);

if ($retval === false) {
throw new DB2Exception(db2_stmt_errormsg());
Expand All @@ -193,7 +193,7 @@ public function execute($params = null)
*/
public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
{
$this->_defaultFetchMode = $fetchMode;
$this->defaultFetchMode = $fetchMode;
$this->defaultFetchClass = $arg2 ?: $this->defaultFetchClass;
$this->defaultFetchClassCtorArgs = $arg3 ? (array) $arg3 : $this->defaultFetchClassCtorArgs;

Expand All @@ -219,16 +219,16 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX
return false;
}

$fetchMode = $fetchMode ?: $this->_defaultFetchMode;
$fetchMode = $fetchMode ?: $this->defaultFetchMode;
switch ($fetchMode) {
case FetchMode::COLUMN:
return $this->fetchColumn();

case FetchMode::MIXED:
return db2_fetch_both($this->_stmt);
return db2_fetch_both($this->stmt);

case FetchMode::ASSOCIATIVE:
return db2_fetch_assoc($this->_stmt);
return db2_fetch_assoc($this->stmt);

case FetchMode::CUSTOM_OBJECT:
$className = $this->defaultFetchClass;
Expand All @@ -240,7 +240,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX
$ctorArgs = $args[2] ?? [];
}

$result = db2_fetch_object($this->_stmt);
$result = db2_fetch_object($this->stmt);

if ($result instanceof stdClass) {
$result = $this->castObject($result, $className, $ctorArgs);
Expand All @@ -249,10 +249,10 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX
return $result;

case FetchMode::NUMERIC:
return db2_fetch_array($this->_stmt);
return db2_fetch_array($this->stmt);

case FetchMode::STANDARD_OBJECT:
return db2_fetch_object($this->_stmt);
return db2_fetch_object($this->stmt);

default:
throw new DB2Exception('Given Fetch-Style ' . $fetchMode . ' is not supported.');
Expand Down Expand Up @@ -305,7 +305,7 @@ public function fetchColumn($columnIndex = 0)
*/
public function rowCount()
{
return @db2_num_rows($this->_stmt) ? : 0;
return @db2_num_rows($this->stmt) ? : 0;
}

/**
Expand Down
Loading

0 comments on commit 1cbadb3

Please sign in to comment.