Commit ba4561f7 authored by Jeroen Thora's avatar Jeroen Thora

minor phpdoc fixes in the remaining files after pr #746

parent 8bf95aae
......@@ -121,7 +121,7 @@ class MasterSlaveConnection extends Connection
$params['slaves'][$slaveKey]['driver'] = $params['driver'];
}
$this->keepSlave = isset($params['keepSlave']) ? (bool)$params['keepSlave'] : false;
$this->keepSlave = isset($params['keepSlave']) ? (bool) $params['keepSlave'] : false;
parent::__construct($params, $driver, $config, $eventManager);
}
......
......@@ -27,7 +27,7 @@ class Connection extends \Doctrine\DBAL\Driver\PDOConnection
/**
* {@inheritdoc}
*/
public function quote($value, $type=\PDO::PARAM_STR)
public function quote($value, $type = \PDO::PARAM_STR)
{
if (\PDO::PARAM_BOOL === $type) {
if ($value) {
......@@ -36,6 +36,7 @@ class Connection extends \Doctrine\DBAL\Driver\PDOConnection
return 'false';
}
}
return parent::quote($value, $type);
}
}
......@@ -78,6 +78,7 @@ class DB2Connection implements Connection, ServerInfoAwareConnection
if ( ! $stmt) {
throw new DB2Exception(db2_stmt_errormsg());
}
return new DB2Statement($stmt);
}
......@@ -90,6 +91,7 @@ class DB2Connection implements Connection, ServerInfoAwareConnection
$sql = $args[0];
$stmt = $this->prepare($sql);
$stmt->execute();
return $stmt;
}
......@@ -113,6 +115,7 @@ class DB2Connection implements Connection, ServerInfoAwareConnection
{
$stmt = $this->prepare($statement);
$stmt->execute();
return $stmt->rowCount();
}
......
......@@ -135,6 +135,7 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
$sql = $args[0];
$stmt = $this->prepare($sql);
$stmt->execute();
return $stmt;
}
......@@ -172,6 +173,7 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
public function beginTransaction()
{
$this->_conn->query('START TRANSACTION');
return true;
}
......
......@@ -97,7 +97,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
$paramCount = $this->_stmt->param_count;
if (0 < $paramCount) {
$this->types = str_repeat('s', $paramCount);
$this->_bindedValues = array_fill(1 , $paramCount, null);
$this->_bindedValues = array_fill(1, $paramCount, null);
}
}
......@@ -178,7 +178,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
$meta->free();
$this->_columnNames = $columnNames;
$this->_rowBindedValues = array_fill(0, count($columnNames), NULL);
$this->_rowBindedValues = array_fill(0, count($columnNames), null);
$refs = array();
foreach ($this->_rowBindedValues as $key => &$value) {
......@@ -228,6 +228,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
foreach ($this->_rowBindedValues as $v) {
$values[] = $v;
}
return $values;
}
......@@ -260,6 +261,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
case PDO::FETCH_BOTH:
$ret = array_combine($this->_columnNames, $values);
$ret += $values;
return $ret;
default:
......@@ -335,6 +337,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
if (false === $this->_columnNames) {
return $this->_stmt->affected_rows;
}
return $this->_stmt->num_rows;
}
......
......@@ -272,7 +272,7 @@ class OCI8Statement implements \IteratorAggregate, Statement
}
oci_fetch_all($this->_sth, $result, 0, -1,
self::$fetchModeMap[$fetchMode] | OCI_RETURN_NULLS | $fetchStructure | OCI_RETURN_LOBS);
self::$fetchModeMap[$fetchMode] | OCI_RETURN_NULLS | $fetchStructure | OCI_RETURN_LOBS);
if ($fetchMode == PDO::FETCH_COLUMN) {
$result = $result[0];
......
......@@ -126,7 +126,7 @@ class SQLSrvStatement implements IteratorAggregate, Statement
*/
public function bindValue($param, $value, $type = null)
{
return $this->bindParam($param, $value, $type,null);
return $this->bindParam($param, $value, $type, null);
}
/**
......
......@@ -155,7 +155,7 @@ class TableGenerator
$this->conn->commit();
} catch(\Exception $e) {
} catch (\Exception $e) {
$this->conn->rollback();
throw new \Doctrine\DBAL\DBALException("Error occurred while generating ID with TableGenerator, aborted generation: " . $e->getMessage(), 0, $e);
}
......
......@@ -263,7 +263,7 @@ class ExpressionBuilder
* Creates a NOT LIKE() comparison expression with the given arguments.
*
* @param string $x Field in string format to be inspected by NOT LIKE() comparison.
* @param mixed $y Argument to be used in NOT LIKE() comparison.
* @param mixed $y Argument to be used in NOT LIKE() comparison.
*
* @return string
*/
......
......@@ -1293,6 +1293,7 @@ class QueryBuilder
{
$this->boundCounter++;
$this->setParameter($this->boundCounter, $value, $type);
return "?";
}
......
......@@ -99,7 +99,7 @@ abstract class AbstractAsset
* The shortest name is stripped of the default namespace. All other
* namespaced elements are returned as full-qualified names.
*
* @param string
* @param string $defaultNamespaceName
*
* @return string
*/
......@@ -180,6 +180,7 @@ abstract class AbstractAsset
if ($this->_namespace) {
return $this->_namespace . "." . $this->_name;
}
return $this->_name;
}
......
......@@ -202,7 +202,7 @@ abstract class AbstractSchemaManager
*/
public function tablesExist($tableNames)
{
$tableNames = array_map('strtolower', (array)$tableNames);
$tableNames = array_map('strtolower', (array) $tableNames);
return count($tableNames) == count(\array_intersect($tableNames, array_map('strtolower', $this->listTableNames())));
}
......@@ -237,9 +237,10 @@ abstract class AbstractSchemaManager
return $assetNames;
}
return array_values (
return array_values(
array_filter($assetNames, function ($assetName) use ($filterExpr) {
$assetName = ($assetName instanceof AbstractAsset) ? $assetName->getName() : $assetName;
return preg_match($filterExpr, $assetName);
})
);
......@@ -952,6 +953,7 @@ abstract class AbstractSchemaManager
/**
* @param array $views
*
* @return array
*/
protected function _getPortableViewsList($views)
......
......@@ -99,8 +99,8 @@ class Column extends AbstractAsset
* Creates a new Column.
*
* @param string $columnName
* @param Type $type
* @param array $options
* @param Type $type
* @param array $options
*/
public function __construct($columnName, Type $type, array $options=array())
{
......@@ -134,6 +134,7 @@ class Column extends AbstractAsset
public function setType(Type $type)
{
$this->_type = $type;
return $this;
}
......@@ -145,7 +146,7 @@ class Column extends AbstractAsset
public function setLength($length)
{
if ($length !== null) {
$this->_length = (int)$length;
$this->_length = (int) $length;
} else {
$this->_length = null;
}
......@@ -164,7 +165,7 @@ class Column extends AbstractAsset
$precision = 10; // defaults to 10 when no valid precision is given.
}
$this->_precision = (int)$precision;
$this->_precision = (int) $precision;
return $this;
}
......@@ -180,7 +181,7 @@ class Column extends AbstractAsset
$scale = 0;
}
$this->_scale = (int)$scale;
$this->_scale = (int) $scale;
return $this;
}
......@@ -192,7 +193,7 @@ class Column extends AbstractAsset
*/
public function setUnsigned($unsigned)
{
$this->_unsigned = (bool)$unsigned;
$this->_unsigned = (bool) $unsigned;
return $this;
}
......@@ -204,7 +205,7 @@ class Column extends AbstractAsset
*/
public function setFixed($fixed)
{
$this->_fixed = (bool)$fixed;
$this->_fixed = (bool) $fixed;
return $this;
}
......@@ -216,7 +217,7 @@ class Column extends AbstractAsset
*/
public function setNotnull($notnull)
{
$this->_notnull = (bool)$notnull;
$this->_notnull = (bool) $notnull;
return $this;
}
......@@ -386,6 +387,7 @@ class Column extends AbstractAsset
public function setAutoincrement($flag)
{
$this->_autoincrement = $flag;
return $this;
}
......
......@@ -87,8 +87,8 @@ class DB2SchemaManager extends AbstractSchemaManager
$options = array(
'length' => $length,
'unsigned' => (bool)$unsigned,
'fixed' => (bool)$fixed,
'unsigned' => (bool) $unsigned,
'fixed' => (bool) $fixed,
'default' => $default,
'autoincrement' => (boolean) $tableColumn['autoincrement'],
'notnull' => (bool) ($tableColumn['nulls'] == 'N'),
......
......@@ -40,12 +40,12 @@ class DrizzleSchemaManager extends AbstractSchemaManager
$tableColumn['COLUMN_COMMENT'] = $this->removeDoctrineTypeFromComment($tableColumn['COLUMN_COMMENT'], $type);
$options = array(
'notnull' => !(bool)$tableColumn['IS_NULLABLE'],
'length' => (int)$tableColumn['CHARACTER_MAXIMUM_LENGTH'],
'notnull' => !(bool) $tableColumn['IS_NULLABLE'],
'length' => (int) $tableColumn['CHARACTER_MAXIMUM_LENGTH'],
'default' => isset($tableColumn['COLUMN_DEFAULT']) ? $tableColumn['COLUMN_DEFAULT'] : null,
'autoincrement' => (bool)$tableColumn['IS_AUTO_INCREMENT'],
'scale' => (int)$tableColumn['NUMERIC_SCALE'],
'precision' => (int)$tableColumn['NUMERIC_PRECISION'],
'autoincrement' => (bool) $tableColumn['IS_AUTO_INCREMENT'],
'scale' => (int) $tableColumn['NUMERIC_SCALE'],
'precision' => (int) $tableColumn['NUMERIC_PRECISION'],
'comment' => isset($tableColumn['COLUMN_COMMENT']) && '' !== $tableColumn['COLUMN_COMMENT']
? $tableColumn['COLUMN_COMMENT']
: null,
......@@ -86,15 +86,15 @@ class DrizzleSchemaManager extends AbstractSchemaManager
$columns[] = trim($value, ' `');
}
$ref_columns = array();
$refColumns = array();
foreach (explode(',', $tableForeignKey['REFERENCED_TABLE_COLUMNS']) as $value) {
$ref_columns[] = trim($value, ' `');
$refColumns[] = trim($value, ' `');
}
return new ForeignKeyConstraint(
$columns,
$tableForeignKey['REFERENCED_TABLE_NAME'],
$ref_columns,
$refColumns,
$tableForeignKey['CONSTRAINT_NAME'],
array(
'onUpdate' => $tableForeignKey['UPDATE_RULE'],
......@@ -110,7 +110,7 @@ class DrizzleSchemaManager extends AbstractSchemaManager
{
$indexes = array();
foreach ($tableIndexes as $k) {
$k['primary'] = (boolean)$k['primary'];
$k['primary'] = (boolean) $k['primary'];
$indexes[] = $k;
}
......
......@@ -231,6 +231,7 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
public function getUnqualifiedForeignTableName()
{
$parts = explode(".", $this->_foreignTableName->getName());
return strtolower(end($parts));
}
......
......@@ -339,6 +339,7 @@ class Index extends AbstractAsset implements Constraint
/**
* Return whether the two indexes have the same partial index
* @param \Doctrine\DBAL\Schema\Index $other
*
* @return boolean
*/
private function samePartialIndex(Index $other)
......
......@@ -124,8 +124,8 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
}
return new ForeignKeyConstraint(
$localColumns, $foreignTable, $foreignColumns, $tableForeignKey['conname'],
array('onUpdate' => $onUpdate, 'onDelete' => $onDelete)
$localColumns, $foreignTable, $foreignColumns, $tableForeignKey['conname'],
array('onUpdate' => $onUpdate, 'onDelete' => $onDelete)
);
}
......
......@@ -206,13 +206,13 @@ class SQLServerSchemaManager extends AbstractSchemaManager
try {
$tableIndexes = $this->_conn->fetchAll($sql);
} catch(\PDOException $e) {
} catch (\PDOException $e) {
if ($e->getCode() == "IMSSP") {
return array();
} else {
throw $e;
}
} catch(SQLSrvException $e) {
} catch (SQLSrvException $e) {
if (strpos($e->getMessage(), 'SQLSTATE [01000, 15472]') === 0) {
return array();
} else {
......
......@@ -63,7 +63,7 @@ class SchemaConfig
*/
public function setExplicitForeignKeyIndexes($flag)
{
$this->hasExplicitForeignKeyIndexes = (bool)$flag;
$this->hasExplicitForeignKeyIndexes = (bool) $flag;
}
/**
......@@ -73,7 +73,7 @@ class SchemaConfig
*/
public function setMaxIdentifierLength($length)
{
$this->maxIdentifierLength = (int)$length;
$this->maxIdentifierLength = (int) $length;
}
/**
......
......@@ -176,6 +176,6 @@ class SchemaException extends \Doctrine\DBAL\DBALException
*/
static public function alterTableChangeNotSupported($changeName)
{
return new self ("Alter table change not supported, given '$changeName'");
return new self("Alter table change not supported, given '$changeName'");
}
}
......@@ -172,6 +172,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
if ($a['pk'] == $b['pk']) {
return $a['cid'] - $b['cid'];
}
return $a['pk'] - $b['pk'];
});
foreach ($indexArray as $indexColumnRow) {
......@@ -286,7 +287,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
$fixed = false;
$type = $this->_platform->getDoctrineTypeMapping($dbType);
$default = $tableColumn['dflt_value'];
if ($default == 'NULL') {
if ($default == 'NULL') {
$default = null;
}
if ($default !== null) {
......
......@@ -47,7 +47,7 @@ abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
foreach ($sql as $s) {
try {
$this->conn->exec($s);
} catch(\Exception $e) {
} catch (\Exception $e) {
}
}
......
......@@ -383,7 +383,7 @@ class Table extends AbstractAsset
*/
public function addForeignKeyConstraint($foreignTable, array $localColumnNames, array $foreignColumnNames, array $options=array(), $constraintName = null)
{
$constraintName = $constraintName ?: $this->_generateIdentifierName(array_merge((array)$this->getName(), $localColumnNames), "fk", $this->_getMaxIdentifierLength());
$constraintName = $constraintName ?: $this->_generateIdentifierName(array_merge((array) $this->getName(), $localColumnNames), "fk", $this->_getMaxIdentifierLength());
return $this->addNamedForeignKeyConstraint($constraintName, $foreignTable, $localColumnNames, $foreignColumnNames, $options);
}
......@@ -532,7 +532,7 @@ class Table extends AbstractAsset
$name = $constraint->getName();
} else {
$name = $this->_generateIdentifierName(
array_merge((array)$this->getName(), $constraint->getLocalColumns()), "fk", $this->_getMaxIdentifierLength()
array_merge((array) $this->getName(), $constraint->getLocalColumns()), "fk", $this->_getMaxIdentifierLength()
);
}
$name = $this->normalizeIdentifier($name);
......
......@@ -103,7 +103,7 @@ class CreateSchemaSqlCollector extends AbstractVisitor
{
$this->createSequenceQueries = array_merge(
$this->createSequenceQueries,
(array)$this->platform->getCreateSequenceSQL($sequence)
(array) $this->platform->getCreateSequenceSQL($sequence)
);
}
......
......@@ -151,10 +151,11 @@ class PoolingShardConnection extends Connection
throw new ShardingException("Cannot switch shard when transaction is active.");
}
$this->activeShardId = (int)$shardId;
$this->activeShardId = (int) $shardId;
if (isset($this->activeConnections[$this->activeShardId])) {
$this->_conn = $this->activeConnections[$this->activeShardId];
return false;
}
......
......@@ -280,6 +280,7 @@ class SQLAzureFederationsSynchronizer extends AbstractSchemaSynchronizer
$defaultValue = '';
break;
}
return $defaultValue;
}
......
......@@ -86,7 +86,7 @@ class SQLAzureShardManager implements ShardManager
$this->federationName = $params['sharding']['federationName'];
$this->distributionKey = $params['sharding']['distributionKey'];
$this->distributionType = $params['sharding']['distributionType'];
$this->filteringEnabled = (isset($params['sharding']['filteringEnabled'])) ? (bool)$params['sharding']['filteringEnabled'] : false;
$this->filteringEnabled = (isset($params['sharding']['filteringEnabled'])) ? (bool) $params['sharding']['filteringEnabled'] : false;
}
/**
......@@ -128,7 +128,7 @@ class SQLAzureShardManager implements ShardManager
*/
public function setFilteringEnabled($flag)
{
$this->filteringEnabled = (bool)$flag;
$this->filteringEnabled = (bool) $flag;
}
/**
......@@ -191,6 +191,7 @@ class SQLAzureShardManager implements ShardManager
FROM sys.federation_member_distributions d
INNER JOIN sys.federations f ON f.federation_id = d.federation_id
WHERE f.name = " . $this->conn->quote($this->federationName);
return $this->conn->fetchAll($sql);
}
......
......@@ -63,7 +63,7 @@ EOT
{
$conn = $this->getHelper('db')->getConnection();
if (($fileNames = $input->getArgument('file')) !== null) {
if (($fileNames = $input->getArgument('file')) !== null) {
foreach ((array) $fileNames as $fileName) {
$filePath = realpath($fileName);
......
......@@ -118,7 +118,7 @@ EOT
/* @var $conn \Doctrine\DBAL\Connection */
$conn = $this->getHelper('db')->getConnection();
$keywordLists = (array)$input->getOption('list');
$keywordLists = (array) $input->getOption('list');
if ( ! $keywordLists) {
$keywordLists = array(
'mysql',
......
......@@ -37,12 +37,12 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
* the offset and re-created from persistence with only the offset, not the original timezone
* attached.
*
* @link www.doctrine-project.org
* @since 1.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
* @link www.doctrine-project.org
* @since 1.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class DateTimeTzType extends Type
{
......
......@@ -50,6 +50,7 @@ class VarDateTimeType extends DateTimeType
if ( ! $val) {
throw ConversionException::conversionFailed($value, $this->getName());
}
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