Skip to content

Commit

Permalink
Fix CS: if (!$var) to if ( ! $var)
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Mar 24, 2012
1 parent 72465c6 commit 8c9e9e8
Show file tree
Hide file tree
Showing 33 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function closeCursor()
$this->statement->closeCursor();
if ($this->emptied && $this->data !== null) {
$data = $this->resultCache->fetch($this->cacheKey);
if (!$data) {
if ( ! $data) {
$data = array();
}
$data[$this->realKey] = $this->data;
Expand Down
10 changes: 5 additions & 5 deletions lib/Doctrine/DBAL/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ public function executeQuery($query, array $params = array(), $types = array(),
public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qcp)
{
$resultCache = $qcp->getResultCacheDriver() ?: $this->_config->getResultCacheImpl();
if (!$resultCache) {
if ( ! $resultCache) {
throw CacheException::noResultDriverConfigured();
}

Expand Down Expand Up @@ -872,7 +872,7 @@ public function setNestTransactionsWithSavepoints($nestTransactionsWithSavepoint
throw ConnectionException::mayNotAlterNestedTransactionWithSavepointsInTransaction();
}

if (!$this->_platform->supportsSavepoints()) {
if ( ! $this->_platform->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported();
}

Expand Down Expand Up @@ -1025,7 +1025,7 @@ public function rollback()
*/
public function createSavepoint($savepoint)
{
if (!$this->_platform->supportsSavepoints()) {
if ( ! $this->_platform->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported();
}

Expand All @@ -1041,7 +1041,7 @@ public function createSavepoint($savepoint)
*/
public function releaseSavepoint($savepoint)
{
if (!$this->_platform->supportsSavepoints()) {
if ( ! $this->_platform->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported();
}

Expand All @@ -1059,7 +1059,7 @@ public function releaseSavepoint($savepoint)
*/
public function rollbackSavepoint($savepoint)
{
if (!$this->_platform->supportsSavepoints()) {
if ( ! $this->_platform->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported();
}

Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ public function __construct(array $params, $username, $password, $driverOptions
} else {
$this->_conn = db2_connect($params['dbname'], $username, $password, $driverOptions);
}
if (!$this->_conn) {
if ( ! $this->_conn) {
throw new DB2Exception(db2_conn_errormsg());
}
}

public function prepare($sql)
{
$stmt = @db2_prepare($this->_conn, $sql);
if (!$stmt) {
if ( ! $stmt) {
throw new DB2Exception(db2_stmt_errormsg());
}
return new DB2Statement($stmt);
Expand Down Expand Up @@ -112,4 +112,4 @@ public function errorInfo()
1 => $this->errorCode(),
);
}
}
}
6 changes: 3 additions & 3 deletions lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function bindParam($column, &$variable, $type = null)
*/
public function closeCursor()
{
if (!$this->_stmt) {
if ( ! $this->_stmt) {
return false;
}

Expand All @@ -93,7 +93,7 @@ public function closeCursor()
*/
public function columnCount()
{
if (!$this->_stmt) {
if ( ! $this->_stmt) {
return false;
}
return db2_num_fields($this->_stmt);
Expand Down Expand Up @@ -123,7 +123,7 @@ public function errorInfo()
*/
public function execute($params = null)
{
if (!$this->_stmt) {
if ( ! $this->_stmt) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(array $params, $username, $password, array $driverOp
$socket = isset($params['unix_socket']) ? $params['unix_socket'] : ini_get('mysqli.default_socket');

$this->_conn = mysqli_init();
if (!$this->_conn->real_connect($params['host'], $username, $password, $params['dbname'], $port, $socket)) {
if ( ! $this->_conn->real_connect($params['host'], $username, $password, $params['dbname'], $port, $socket)) {
throw new MysqliException($this->_conn->connect_error, $this->_conn->connect_errno);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function execute($params = null)
{
if (null !== $this->_bindedValues) {
if (null !== $params) {
if (!$this->_bindValues($params)) {
if ( ! $this->_bindValues($params)) {
throw new MysqliException($this->_stmt->error, $this->_stmt->errno);
}
} else {
Expand All @@ -141,7 +141,7 @@ public function execute($params = null)
}
}

if (!$this->_stmt->execute()) {
if ( ! $this->_stmt->execute()) {
throw new MysqliException($this->_stmt->error, $this->_stmt->errno);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct($username, $password, $db, $charset = null, $session
}

$this->_dbh = @oci_connect($username, $password, $db, $charset, $sessionMode);
if (!$this->_dbh) {
if ( ! $this->_dbh) {
throw OCI8Exception::fromErrorInfo(oci_error());
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SQLSrvConnection implements \Doctrine\DBAL\Driver\Connection
public function __construct($serverName, $connectionOptions)
{
$this->conn = sqlsrv_connect($serverName, $connectionOptions);
if (!$this->conn) {
if ( ! $this->conn) {
throw SQLSrvException::fromSqlSrvErrors();
}
$this->lastInsertId = new LastInsertId();
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static public function fromSqlSrvErrors()
foreach ($errors as $error) {
$message .= "SQLSTATE [".$error['SQLSTATE'].", ".$error['code']."]: ". $error['message']."\n";
}
if (!$message) {
if ( ! $message) {
$message = "SQL Server error occured but no error message was retrieved from driver.";
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function execute($params = null)
}

$this->stmt = sqlsrv_query($this->conn, $this->sql, $this->params);
if (!$this->stmt) {
if ( ! $this->stmt) {
throw SQLSrvException::fromSqlSrvErrors();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SchemaDropTableEventArgs extends SchemaEventArgs
*/
public function __construct($table, AbstractPlatform $platform)
{
if (!$table instanceof Table && !is_string($table)) {
if ( ! $table instanceof Table && !is_string($table)) {
throw new \InvalidArgumentException('SchemaCreateTableEventArgs expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.');
}

Expand Down
12 changes: 6 additions & 6 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ protected function onSchemaAlterTableAddColumn(Column $column, TableDiff $diff,
return false;
}

if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableAddColumn)) {
if ( ! $this->_eventManager->hasListeners(Events::onSchemaAlterTableAddColumn)) {
return false;
}

Expand All @@ -1410,7 +1410,7 @@ protected function onSchemaAlterTableRemoveColumn(Column $column, TableDiff $dif
return false;
}

if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableRemoveColumn)) {
if ( ! $this->_eventManager->hasListeners(Events::onSchemaAlterTableRemoveColumn)) {
return false;
}

Expand All @@ -1433,7 +1433,7 @@ protected function onSchemaAlterTableChangeColumn(ColumnDiff $columnDiff, TableD
return false;
}

if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableChangeColumn)) {
if ( ! $this->_eventManager->hasListeners(Events::onSchemaAlterTableChangeColumn)) {
return false;
}

Expand All @@ -1457,7 +1457,7 @@ protected function onSchemaAlterTableRenameColumn($oldColumnName, Column $column
return false;
}

if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableRenameColumn)) {
if ( ! $this->_eventManager->hasListeners(Events::onSchemaAlterTableRenameColumn)) {
return false;
}

Expand All @@ -1478,7 +1478,7 @@ protected function onSchemaAlterTable(TableDiff $diff, &$sql)
return false;
}

if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTable)) {
if ( ! $this->_eventManager->hasListeners(Events::onSchemaAlterTable)) {
return false;
}

Expand Down Expand Up @@ -2672,7 +2672,7 @@ final public function getReservedKeywordsList()
{
$class = $this->getReservedKeywordsClass();
$keywords = new $class;
if (!$keywords instanceof \Doctrine\DBAL\Platforms\Keywords\KeywordList) {
if ( ! $keywords instanceof \Doctrine\DBAL\Platforms\Keywords\KeywordList) {
throw DBALException::notSupported(__METHOD__);
}
return $keywords;
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/DB2Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public function getAlterTableSQL(TableDiff $diff)

$tableSql = array();

if (!$this->onSchemaAlterTable($diff, $tableSql)) {
if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
if (count($queryParts) > 0) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(" ", $queryParts);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public function getAlterTableSQL(TableDiff $diff)
$sql = array();
$tableSql = array();

if (!$this->onSchemaAlterTable($diff, $tableSql)) {
if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
if (count($queryParts) > 0) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(", ", $queryParts);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private function isReservedWord($word)

private function addViolation($asset, $violatedPlatforms)
{
if (!$violatedPlatforms) {
if ( ! $violatedPlatforms) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ public function getAlterTableSQL(TableDiff $diff)
$sql = array();
$tableSql = array();

if (!$this->onSchemaAlterTable($diff, $tableSql)) {
if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
if (count($queryParts) > 0) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(", ", $queryParts);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/OraclePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ public function getAlterTableSQL(TableDiff $diff)

$tableSql = array();

if (!$this->onSchemaAlterTable($diff, $tableSql)) {
if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
if ($diff->newName !== false) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME TO ' . $diff->newName;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public function getAlterTableSQL(TableDiff $diff)

$tableSql = array();

if (!$this->onSchemaAlterTable($diff, $tableSql)) {
if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
if ($diff->newName !== false) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME TO ' . $diff->newName;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public function getTrimExpression($str, $pos = self::TRIM_UNSPECIFIED, $char = f
{
$trimFn = '';

if (!$char) {
if ( ! $char) {
if ($pos == self::TRIM_LEADING) {
$trimFn = 'LTRIM';
} else if ($pos == self::TRIM_TRAILING) {
Expand Down Expand Up @@ -692,7 +692,7 @@ protected function doModifyLimitQuery($query, $limit, $offset = null)
} else {
$orderby = stristr($query, 'ORDER BY');

if (!$orderby) {
if ( ! $orderby) {
$over = 'ORDER BY (SELECT 0)';
} else {
$over = preg_replace('/\"[^,]*\".\"([^,]*)\"/i', '"inner_tbl"."$1"', $orderby);
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Portability/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function fetchAll($fetchStyle = PDO::FETCH_BOTH, $columnIndex = 0)

$iterateRow = $this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM);
$fixCase = !is_null($this->case) && ($fetchStyle == PDO::FETCH_ASSOC || $fetchStyle == PDO::FETCH_BOTH) && ($this->portability & Connection::PORTABILITY_FIX_CASE);
if (!$iterateRow && !$fixCase) {
if ( ! $iterateRow && !$fixCase) {
return $rows;
}

Expand All @@ -147,7 +147,7 @@ public function fetchAll($fetchStyle = PDO::FETCH_BOTH, $columnIndex = 0)

protected function fixRow($row, $iterateRow, $fixCase)
{
if (!$row) {
if ( ! $row) {
return $row;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Schema/AbstractAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function getShortestName($defaultNamespaceName)
public function getFullQualifiedName($defaultNamespaceName)
{
$name = $this->getName();
if (!$this->_namespace) {
if ( ! $this->_namespace) {
$name = $defaultNamespaceName . "." . $name;
}
return strtolower($name);
Expand Down
8 changes: 4 additions & 4 deletions lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function listSequences($database = null)
*/
public function listTableColumns($table, $database = null)
{
if (!$database) {
if ( ! $database) {
$database = $this->_conn->getDatabase();
}

Expand Down Expand Up @@ -212,7 +212,7 @@ public function listTableNames()
protected function filterAssetNames($assetNames)
{
$filterExpr = $this->getFilterSchemaAssetsExpression();
if (!$filterExpr) {
if ( ! $filterExpr) {
return $assetNames;
}
return array_values (
Expand Down Expand Up @@ -668,7 +668,7 @@ protected function _getPortableTableColumnList($table, $database, $tableColumns)
$column = $eventArgs->getColumn();
}

if (!$defaultPrevented) {
if ( ! $defaultPrevented) {
$column = $this->_getPortableTableColumnDefinition($tableColumn);
}

Expand Down Expand Up @@ -733,7 +733,7 @@ protected function _getPortableTableIndexesList($tableIndexRows, $tableName=null
$index = $eventArgs->getIndex();
}

if (!$defaultPrevented) {
if ( ! $defaultPrevented) {
$index = new Index($data['name'], $data['columns'], $data['unique'], $data['primary'], $data['flags']);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Schema/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function compare(Schema $fromSchema, Schema $toSchema)

foreach ($toSchema->getSequences() as $sequence) {
$sequenceName = $sequence->getShortestName($toSchema->getName());
if (!$fromSchema->hasSequence($sequenceName)) {
if ( ! $fromSchema->hasSequence($sequenceName)) {
$diff->newSequences[] = $sequence;
} else {
if ($this->diffSequence($sequence, $fromSchema->getSequence($sequenceName))) {
Expand All @@ -111,7 +111,7 @@ public function compare(Schema $fromSchema, Schema $toSchema)

foreach ($fromSchema->getSequences() as $sequence) {
$sequenceName = $sequence->getShortestName($fromSchema->getName());
if (!$toSchema->hasSequence($sequenceName)) {
if ( ! $toSchema->hasSequence($sequenceName)) {
$diff->removedSequences[] = $sequence;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Schema/DB2SchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected function _getPortableTableIndexesList($tableIndexes, $tableName=null)
$index = $eventArgs->getIndex();
}

if (!$defaultPrevented) {
if ( ! $defaultPrevented) {
$index = new Index($data['name'], $data['columns'], $data['unique'], $data['primary']);
}

Expand Down
Loading

0 comments on commit 8c9e9e8

Please sign in to comment.