Commit 8c9e9e81 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Fix CS: if (!$var) to if ( ! $var)

parent 72465c6f
...@@ -109,7 +109,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement ...@@ -109,7 +109,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
$this->statement->closeCursor(); $this->statement->closeCursor();
if ($this->emptied && $this->data !== null) { if ($this->emptied && $this->data !== null) {
$data = $this->resultCache->fetch($this->cacheKey); $data = $this->resultCache->fetch($this->cacheKey);
if (!$data) { if ( ! $data) {
$data = array(); $data = array();
} }
$data[$this->realKey] = $this->data; $data[$this->realKey] = $this->data;
......
...@@ -652,7 +652,7 @@ class Connection implements DriverConnection ...@@ -652,7 +652,7 @@ class Connection implements DriverConnection
public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qcp) public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qcp)
{ {
$resultCache = $qcp->getResultCacheDriver() ?: $this->_config->getResultCacheImpl(); $resultCache = $qcp->getResultCacheDriver() ?: $this->_config->getResultCacheImpl();
if (!$resultCache) { if ( ! $resultCache) {
throw CacheException::noResultDriverConfigured(); throw CacheException::noResultDriverConfigured();
} }
...@@ -872,7 +872,7 @@ class Connection implements DriverConnection ...@@ -872,7 +872,7 @@ class Connection implements DriverConnection
throw ConnectionException::mayNotAlterNestedTransactionWithSavepointsInTransaction(); throw ConnectionException::mayNotAlterNestedTransactionWithSavepointsInTransaction();
} }
if (!$this->_platform->supportsSavepoints()) { if ( ! $this->_platform->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported(); throw ConnectionException::savepointsNotSupported();
} }
...@@ -1025,7 +1025,7 @@ class Connection implements DriverConnection ...@@ -1025,7 +1025,7 @@ class Connection implements DriverConnection
*/ */
public function createSavepoint($savepoint) public function createSavepoint($savepoint)
{ {
if (!$this->_platform->supportsSavepoints()) { if ( ! $this->_platform->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported(); throw ConnectionException::savepointsNotSupported();
} }
...@@ -1041,7 +1041,7 @@ class Connection implements DriverConnection ...@@ -1041,7 +1041,7 @@ class Connection implements DriverConnection
*/ */
public function releaseSavepoint($savepoint) public function releaseSavepoint($savepoint)
{ {
if (!$this->_platform->supportsSavepoints()) { if ( ! $this->_platform->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported(); throw ConnectionException::savepointsNotSupported();
} }
...@@ -1059,7 +1059,7 @@ class Connection implements DriverConnection ...@@ -1059,7 +1059,7 @@ class Connection implements DriverConnection
*/ */
public function rollbackSavepoint($savepoint) public function rollbackSavepoint($savepoint)
{ {
if (!$this->_platform->supportsSavepoints()) { if ( ! $this->_platform->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported(); throw ConnectionException::savepointsNotSupported();
} }
......
...@@ -34,7 +34,7 @@ class DB2Connection implements \Doctrine\DBAL\Driver\Connection ...@@ -34,7 +34,7 @@ class DB2Connection implements \Doctrine\DBAL\Driver\Connection
} else { } 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()); throw new DB2Exception(db2_conn_errormsg());
} }
} }
...@@ -42,7 +42,7 @@ class DB2Connection implements \Doctrine\DBAL\Driver\Connection ...@@ -42,7 +42,7 @@ class DB2Connection implements \Doctrine\DBAL\Driver\Connection
public function prepare($sql) public function prepare($sql)
{ {
$stmt = @db2_prepare($this->_conn, $sql); $stmt = @db2_prepare($this->_conn, $sql);
if (!$stmt) { if ( ! $stmt) {
throw new DB2Exception(db2_stmt_errormsg()); throw new DB2Exception(db2_stmt_errormsg());
} }
return new DB2Statement($stmt); return new DB2Statement($stmt);
......
...@@ -77,7 +77,7 @@ class DB2Statement implements \IteratorAggregate, Statement ...@@ -77,7 +77,7 @@ class DB2Statement implements \IteratorAggregate, Statement
*/ */
public function closeCursor() public function closeCursor()
{ {
if (!$this->_stmt) { if ( ! $this->_stmt) {
return false; return false;
} }
...@@ -93,7 +93,7 @@ class DB2Statement implements \IteratorAggregate, Statement ...@@ -93,7 +93,7 @@ class DB2Statement implements \IteratorAggregate, Statement
*/ */
public function columnCount() public function columnCount()
{ {
if (!$this->_stmt) { if ( ! $this->_stmt) {
return false; return false;
} }
return db2_num_fields($this->_stmt); return db2_num_fields($this->_stmt);
...@@ -123,7 +123,7 @@ class DB2Statement implements \IteratorAggregate, Statement ...@@ -123,7 +123,7 @@ class DB2Statement implements \IteratorAggregate, Statement
*/ */
public function execute($params = null) public function execute($params = null)
{ {
if (!$this->_stmt) { if ( ! $this->_stmt) {
return false; return false;
} }
......
...@@ -37,7 +37,7 @@ class MysqliConnection implements Connection ...@@ -37,7 +37,7 @@ class MysqliConnection implements Connection
$socket = isset($params['unix_socket']) ? $params['unix_socket'] : ini_get('mysqli.default_socket'); $socket = isset($params['unix_socket']) ? $params['unix_socket'] : ini_get('mysqli.default_socket');
$this->_conn = mysqli_init(); $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); throw new MysqliException($this->_conn->connect_error, $this->_conn->connect_errno);
} }
......
...@@ -131,7 +131,7 @@ class MysqliStatement implements \IteratorAggregate, Statement ...@@ -131,7 +131,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
{ {
if (null !== $this->_bindedValues) { if (null !== $this->_bindedValues) {
if (null !== $params) { if (null !== $params) {
if (!$this->_bindValues($params)) { if ( ! $this->_bindValues($params)) {
throw new MysqliException($this->_stmt->error, $this->_stmt->errno); throw new MysqliException($this->_stmt->error, $this->_stmt->errno);
} }
} else { } else {
...@@ -141,7 +141,7 @@ class MysqliStatement implements \IteratorAggregate, Statement ...@@ -141,7 +141,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
} }
} }
if (!$this->_stmt->execute()) { if ( ! $this->_stmt->execute()) {
throw new MysqliException($this->_stmt->error, $this->_stmt->errno); throw new MysqliException($this->_stmt->error, $this->_stmt->errno);
} }
......
...@@ -44,7 +44,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection ...@@ -44,7 +44,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
} }
$this->_dbh = @oci_connect($username, $password, $db, $charset, $sessionMode); $this->_dbh = @oci_connect($username, $password, $db, $charset, $sessionMode);
if (!$this->_dbh) { if ( ! $this->_dbh) {
throw OCI8Exception::fromErrorInfo(oci_error()); throw OCI8Exception::fromErrorInfo(oci_error());
} }
} }
......
...@@ -41,7 +41,7 @@ class SQLSrvConnection implements \Doctrine\DBAL\Driver\Connection ...@@ -41,7 +41,7 @@ class SQLSrvConnection implements \Doctrine\DBAL\Driver\Connection
public function __construct($serverName, $connectionOptions) public function __construct($serverName, $connectionOptions)
{ {
$this->conn = sqlsrv_connect($serverName, $connectionOptions); $this->conn = sqlsrv_connect($serverName, $connectionOptions);
if (!$this->conn) { if ( ! $this->conn) {
throw SQLSrvException::fromSqlSrvErrors(); throw SQLSrvException::fromSqlSrvErrors();
} }
$this->lastInsertId = new LastInsertId(); $this->lastInsertId = new LastInsertId();
......
...@@ -33,7 +33,7 @@ class SQLSrvException extends \Doctrine\DBAL\DBALException ...@@ -33,7 +33,7 @@ class SQLSrvException extends \Doctrine\DBAL\DBALException
foreach ($errors as $error) { foreach ($errors as $error) {
$message .= "SQLSTATE [".$error['SQLSTATE'].", ".$error['code']."]: ". $error['message']."\n"; $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."; $message = "SQL Server error occured but no error message was retrieved from driver.";
} }
......
...@@ -164,7 +164,7 @@ class SQLSrvStatement implements IteratorAggregate, Statement ...@@ -164,7 +164,7 @@ class SQLSrvStatement implements IteratorAggregate, Statement
} }
$this->stmt = sqlsrv_query($this->conn, $this->sql, $this->params); $this->stmt = sqlsrv_query($this->conn, $this->sql, $this->params);
if (!$this->stmt) { if ( ! $this->stmt) {
throw SQLSrvException::fromSqlSrvErrors(); throw SQLSrvException::fromSqlSrvErrors();
} }
......
...@@ -53,7 +53,7 @@ class SchemaDropTableEventArgs extends SchemaEventArgs ...@@ -53,7 +53,7 @@ class SchemaDropTableEventArgs extends SchemaEventArgs
*/ */
public function __construct($table, AbstractPlatform $platform) 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.'); throw new \InvalidArgumentException('SchemaCreateTableEventArgs expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.');
} }
......
...@@ -1387,7 +1387,7 @@ abstract class AbstractPlatform ...@@ -1387,7 +1387,7 @@ abstract class AbstractPlatform
return false; return false;
} }
if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableAddColumn)) { if ( ! $this->_eventManager->hasListeners(Events::onSchemaAlterTableAddColumn)) {
return false; return false;
} }
...@@ -1410,7 +1410,7 @@ abstract class AbstractPlatform ...@@ -1410,7 +1410,7 @@ abstract class AbstractPlatform
return false; return false;
} }
if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableRemoveColumn)) { if ( ! $this->_eventManager->hasListeners(Events::onSchemaAlterTableRemoveColumn)) {
return false; return false;
} }
...@@ -1433,7 +1433,7 @@ abstract class AbstractPlatform ...@@ -1433,7 +1433,7 @@ abstract class AbstractPlatform
return false; return false;
} }
if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableChangeColumn)) { if ( ! $this->_eventManager->hasListeners(Events::onSchemaAlterTableChangeColumn)) {
return false; return false;
} }
...@@ -1457,7 +1457,7 @@ abstract class AbstractPlatform ...@@ -1457,7 +1457,7 @@ abstract class AbstractPlatform
return false; return false;
} }
if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTableRenameColumn)) { if ( ! $this->_eventManager->hasListeners(Events::onSchemaAlterTableRenameColumn)) {
return false; return false;
} }
...@@ -1478,7 +1478,7 @@ abstract class AbstractPlatform ...@@ -1478,7 +1478,7 @@ abstract class AbstractPlatform
return false; return false;
} }
if (!$this->_eventManager->hasListeners(Events::onSchemaAlterTable)) { if ( ! $this->_eventManager->hasListeners(Events::onSchemaAlterTable)) {
return false; return false;
} }
...@@ -2672,7 +2672,7 @@ abstract class AbstractPlatform ...@@ -2672,7 +2672,7 @@ abstract class AbstractPlatform
{ {
$class = $this->getReservedKeywordsClass(); $class = $this->getReservedKeywordsClass();
$keywords = new $class; $keywords = new $class;
if (!$keywords instanceof \Doctrine\DBAL\Platforms\Keywords\KeywordList) { if ( ! $keywords instanceof \Doctrine\DBAL\Platforms\Keywords\KeywordList) {
throw DBALException::notSupported(__METHOD__); throw DBALException::notSupported(__METHOD__);
} }
return $keywords; return $keywords;
......
...@@ -413,7 +413,7 @@ class DB2Platform extends AbstractPlatform ...@@ -413,7 +413,7 @@ class DB2Platform extends AbstractPlatform
$tableSql = array(); $tableSql = array();
if (!$this->onSchemaAlterTable($diff, $tableSql)) { if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
if (count($queryParts) > 0) { if (count($queryParts) > 0) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(" ", $queryParts); $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(" ", $queryParts);
} }
......
...@@ -347,7 +347,7 @@ class DrizzlePlatform extends AbstractPlatform ...@@ -347,7 +347,7 @@ class DrizzlePlatform extends AbstractPlatform
$sql = array(); $sql = array();
$tableSql = array(); $tableSql = array();
if (!$this->onSchemaAlterTable($diff, $tableSql)) { if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
if (count($queryParts) > 0) { if (count($queryParts) > 0) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(", ", $queryParts); $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(", ", $queryParts);
} }
......
...@@ -71,7 +71,7 @@ class ReservedKeywordsValidator implements Visitor ...@@ -71,7 +71,7 @@ class ReservedKeywordsValidator implements Visitor
private function addViolation($asset, $violatedPlatforms) private function addViolation($asset, $violatedPlatforms)
{ {
if (!$violatedPlatforms) { if ( ! $violatedPlatforms) {
return; return;
} }
......
...@@ -505,7 +505,7 @@ class MySqlPlatform extends AbstractPlatform ...@@ -505,7 +505,7 @@ class MySqlPlatform extends AbstractPlatform
$sql = array(); $sql = array();
$tableSql = array(); $tableSql = array();
if (!$this->onSchemaAlterTable($diff, $tableSql)) { if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
if (count($queryParts) > 0) { if (count($queryParts) > 0) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(", ", $queryParts); $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(", ", $queryParts);
} }
......
...@@ -624,7 +624,7 @@ LEFT JOIN user_cons_columns r_cols ...@@ -624,7 +624,7 @@ LEFT JOIN user_cons_columns r_cols
$tableSql = array(); $tableSql = array();
if (!$this->onSchemaAlterTable($diff, $tableSql)) { if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
if ($diff->newName !== false) { if ($diff->newName !== false) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME TO ' . $diff->newName; $sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME TO ' . $diff->newName;
} }
......
...@@ -457,7 +457,7 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -457,7 +457,7 @@ class PostgreSqlPlatform extends AbstractPlatform
$tableSql = array(); $tableSql = array();
if (!$this->onSchemaAlterTable($diff, $tableSql)) { if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
if ($diff->newName !== false) { if ($diff->newName !== false) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME TO ' . $diff->newName; $sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME TO ' . $diff->newName;
} }
......
...@@ -509,7 +509,7 @@ class SQLServerPlatform extends AbstractPlatform ...@@ -509,7 +509,7 @@ class SQLServerPlatform extends AbstractPlatform
{ {
$trimFn = ''; $trimFn = '';
if (!$char) { if ( ! $char) {
if ($pos == self::TRIM_LEADING) { if ($pos == self::TRIM_LEADING) {
$trimFn = 'LTRIM'; $trimFn = 'LTRIM';
} else if ($pos == self::TRIM_TRAILING) { } else if ($pos == self::TRIM_TRAILING) {
...@@ -692,7 +692,7 @@ class SQLServerPlatform extends AbstractPlatform ...@@ -692,7 +692,7 @@ class SQLServerPlatform extends AbstractPlatform
} else { } else {
$orderby = stristr($query, 'ORDER BY'); $orderby = stristr($query, 'ORDER BY');
if (!$orderby) { if ( ! $orderby) {
$over = 'ORDER BY (SELECT 0)'; $over = 'ORDER BY (SELECT 0)';
} else { } else {
$over = preg_replace('/\"[^,]*\".\"([^,]*)\"/i', '"inner_tbl"."$1"', $orderby); $over = preg_replace('/\"[^,]*\".\"([^,]*)\"/i', '"inner_tbl"."$1"', $orderby);
......
...@@ -134,7 +134,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement ...@@ -134,7 +134,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
$iterateRow = $this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM); $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); $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; return $rows;
} }
...@@ -147,7 +147,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement ...@@ -147,7 +147,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
protected function fixRow($row, $iterateRow, $fixCase) protected function fixRow($row, $iterateRow, $fixCase)
{ {
if (!$row) { if ( ! $row) {
return $row; return $row;
} }
......
...@@ -123,7 +123,7 @@ abstract class AbstractAsset ...@@ -123,7 +123,7 @@ abstract class AbstractAsset
public function getFullQualifiedName($defaultNamespaceName) public function getFullQualifiedName($defaultNamespaceName)
{ {
$name = $this->getName(); $name = $this->getName();
if (!$this->_namespace) { if ( ! $this->_namespace) {
$name = $defaultNamespaceName . "." . $name; $name = $defaultNamespaceName . "." . $name;
} }
return strtolower($name); return strtolower($name);
......
...@@ -148,7 +148,7 @@ abstract class AbstractSchemaManager ...@@ -148,7 +148,7 @@ abstract class AbstractSchemaManager
*/ */
public function listTableColumns($table, $database = null) public function listTableColumns($table, $database = null)
{ {
if (!$database) { if ( ! $database) {
$database = $this->_conn->getDatabase(); $database = $this->_conn->getDatabase();
} }
...@@ -212,7 +212,7 @@ abstract class AbstractSchemaManager ...@@ -212,7 +212,7 @@ abstract class AbstractSchemaManager
protected function filterAssetNames($assetNames) protected function filterAssetNames($assetNames)
{ {
$filterExpr = $this->getFilterSchemaAssetsExpression(); $filterExpr = $this->getFilterSchemaAssetsExpression();
if (!$filterExpr) { if ( ! $filterExpr) {
return $assetNames; return $assetNames;
} }
return array_values ( return array_values (
...@@ -668,7 +668,7 @@ abstract class AbstractSchemaManager ...@@ -668,7 +668,7 @@ abstract class AbstractSchemaManager
$column = $eventArgs->getColumn(); $column = $eventArgs->getColumn();
} }
if (!$defaultPrevented) { if ( ! $defaultPrevented) {
$column = $this->_getPortableTableColumnDefinition($tableColumn); $column = $this->_getPortableTableColumnDefinition($tableColumn);
} }
...@@ -733,7 +733,7 @@ abstract class AbstractSchemaManager ...@@ -733,7 +733,7 @@ abstract class AbstractSchemaManager
$index = $eventArgs->getIndex(); $index = $eventArgs->getIndex();
} }
if (!$defaultPrevented) { if ( ! $defaultPrevented) {
$index = new Index($data['name'], $data['columns'], $data['unique'], $data['primary'], $data['flags']); $index = new Index($data['name'], $data['columns'], $data['unique'], $data['primary'], $data['flags']);
} }
......
...@@ -100,7 +100,7 @@ class Comparator ...@@ -100,7 +100,7 @@ class Comparator
foreach ($toSchema->getSequences() as $sequence) { foreach ($toSchema->getSequences() as $sequence) {
$sequenceName = $sequence->getShortestName($toSchema->getName()); $sequenceName = $sequence->getShortestName($toSchema->getName());
if (!$fromSchema->hasSequence($sequenceName)) { if ( ! $fromSchema->hasSequence($sequenceName)) {
$diff->newSequences[] = $sequence; $diff->newSequences[] = $sequence;
} else { } else {
if ($this->diffSequence($sequence, $fromSchema->getSequence($sequenceName))) { if ($this->diffSequence($sequence, $fromSchema->getSequence($sequenceName))) {
...@@ -111,7 +111,7 @@ class Comparator ...@@ -111,7 +111,7 @@ class Comparator
foreach ($fromSchema->getSequences() as $sequence) { foreach ($fromSchema->getSequences() as $sequence) {
$sequenceName = $sequence->getShortestName($fromSchema->getName()); $sequenceName = $sequence->getShortestName($fromSchema->getName());
if (!$toSchema->hasSequence($sequenceName)) { if ( ! $toSchema->hasSequence($sequenceName)) {
$diff->removedSequences[] = $sequence; $diff->removedSequences[] = $sequence;
} }
} }
......
...@@ -156,7 +156,7 @@ class DB2SchemaManager extends AbstractSchemaManager ...@@ -156,7 +156,7 @@ class DB2SchemaManager extends AbstractSchemaManager
$index = $eventArgs->getIndex(); $index = $eventArgs->getIndex();
} }
if (!$defaultPrevented) { if ( ! $defaultPrevented) {
$index = new Index($data['name'], $data['columns'], $data['unique'], $data['primary']); $index = new Index($data['name'], $data['columns'], $data['unique'], $data['primary']);
} }
......
...@@ -160,7 +160,7 @@ class Index extends AbstractAsset implements Constraint ...@@ -160,7 +160,7 @@ class Index extends AbstractAsset implements Constraint
$sameColumns = $this->spansColumns($other->getColumns()); $sameColumns = $this->spansColumns($other->getColumns());
if ($sameColumns) { if ($sameColumns) {
if (!$this->isUnique() && !$this->isPrimary()) { if ( ! $this->isUnique() && !$this->isPrimary()) {
// this is a special case: If the current key is neither primary or unique, any uniqe or // this is a special case: If the current key is neither primary or unique, any uniqe or
// primary key will always have the same effect for the index and there cannot be any constraint // primary key will always have the same effect for the index and there cannot be any constraint
// overlaps. This means a primary or unique index can always fullfill the requirements of just an // overlaps. This means a primary or unique index can always fullfill the requirements of just an
......
...@@ -144,7 +144,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager ...@@ -144,7 +144,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
$index = $eventArgs->getIndex(); $index = $eventArgs->getIndex();
} }
if (!$defaultPrevented) { if ( ! $defaultPrevented) {
$index = new Index($data['name'], $data['columns'], $data['unique'], $data['primary']); $index = new Index($data['name'], $data['columns'], $data['unique'], $data['primary']);
} }
......
...@@ -180,7 +180,7 @@ class Table extends AbstractAsset ...@@ -180,7 +180,7 @@ class Table extends AbstractAsset
public function dropIndex($indexName) public function dropIndex($indexName)
{ {
$indexName = strtolower($indexName); $indexName = strtolower($indexName);
if (!$this->hasIndex($indexName)) { if ( ! $this->hasIndex($indexName)) {
throw SchemaException::indexDoesNotExist($indexName, $this->_name); throw SchemaException::indexDoesNotExist($indexName, $this->_name);
} }
unset($this->_indexes[$indexName]); unset($this->_indexes[$indexName]);
...@@ -549,7 +549,7 @@ class Table extends AbstractAsset ...@@ -549,7 +549,7 @@ class Table extends AbstractAsset
public function getColumn($columnName) public function getColumn($columnName)
{ {
$columnName = strtolower($this->trimQuotes($columnName)); $columnName = strtolower($this->trimQuotes($columnName));
if (!$this->hasColumn($columnName)) { if ( ! $this->hasColumn($columnName)) {
throw SchemaException::columnDoesNotExist($columnName, $this->_name); throw SchemaException::columnDoesNotExist($columnName, $this->_name);
} }
...@@ -561,7 +561,7 @@ class Table extends AbstractAsset ...@@ -561,7 +561,7 @@ class Table extends AbstractAsset
*/ */
public function getPrimaryKey() public function getPrimaryKey()
{ {
if (!$this->hasPrimaryKey()) { if ( ! $this->hasPrimaryKey()) {
return null; return null;
} }
return $this->getIndex($this->_primaryKeyName); return $this->getIndex($this->_primaryKeyName);
...@@ -594,7 +594,7 @@ class Table extends AbstractAsset ...@@ -594,7 +594,7 @@ class Table extends AbstractAsset
public function getIndex($indexName) public function getIndex($indexName)
{ {
$indexName = strtolower($indexName); $indexName = strtolower($indexName);
if (!$this->hasIndex($indexName)) { if ( ! $this->hasIndex($indexName)) {
throw SchemaException::indexDoesNotExist($indexName, $this->_name); throw SchemaException::indexDoesNotExist($indexName, $this->_name);
} }
return $this->_indexes[$indexName]; return $this->_indexes[$indexName];
......
...@@ -97,7 +97,7 @@ EOT ...@@ -97,7 +97,7 @@ EOT
$conn = $this->getHelper('db')->getConnection(); $conn = $this->getHelper('db')->getConnection();
$keywordLists = (array)$input->getOption('list'); $keywordLists = (array)$input->getOption('list');
if (!$keywordLists) { if ( ! $keywordLists) {
$keywordLists = array('mysql', 'pgsql', 'sqlite', 'oracle', 'mssql'); $keywordLists = array('mysql', 'pgsql', 'sqlite', 'oracle', 'mssql');
} }
......
...@@ -51,7 +51,7 @@ class DateTimeType extends Type ...@@ -51,7 +51,7 @@ class DateTimeType extends Type
} }
$val = \DateTime::createFromFormat($platform->getDateTimeFormatString(), $value); $val = \DateTime::createFromFormat($platform->getDateTimeFormatString(), $value);
if (!$val) { if ( ! $val) {
throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateTimeFormatString()); throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateTimeFormatString());
} }
return $val; return $val;
......
...@@ -71,7 +71,7 @@ class DateTimeTzType extends Type ...@@ -71,7 +71,7 @@ class DateTimeTzType extends Type
} }
$val = \DateTime::createFromFormat($platform->getDateTimeTzFormatString(), $value); $val = \DateTime::createFromFormat($platform->getDateTimeTzFormatString(), $value);
if (!$val) { if ( ! $val) {
throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateTimeTzFormatString()); throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateTimeTzFormatString());
} }
return $val; return $val;
......
...@@ -51,7 +51,7 @@ class DateType extends Type ...@@ -51,7 +51,7 @@ class DateType extends Type
} }
$val = \DateTime::createFromFormat('!'.$platform->getDateFormatString(), $value); $val = \DateTime::createFromFormat('!'.$platform->getDateFormatString(), $value);
if (!$val) { if ( ! $val) {
throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateFormatString()); throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateFormatString());
} }
return $val; return $val;
......
...@@ -60,7 +60,7 @@ class TimeType extends Type ...@@ -60,7 +60,7 @@ class TimeType extends Type
} }
$val = \DateTime::createFromFormat($platform->getTimeFormatString(), $value); $val = \DateTime::createFromFormat($platform->getTimeFormatString(), $value);
if (!$val) { if ( ! $val) {
throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getTimeFormatString()); throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getTimeFormatString());
} }
return $val; return $val;
......
...@@ -52,7 +52,7 @@ class VarDateTimeType extends DateTimeType ...@@ -52,7 +52,7 @@ class VarDateTimeType extends DateTimeType
} }
$val = date_create($value); $val = date_create($value);
if (!$val) { if ( ! $val) {
throw ConversionException::conversionFailed($value, $this->getName()); throw ConversionException::conversionFailed($value, $this->getName());
} }
return $val; return $val;
......
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