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

Declare return types in a BC compatible manner

parent f440d92c
......@@ -140,6 +140,8 @@ class Configuration
* @see getAutoCommit
*
* @param bool $autoCommit True to enable auto-commit mode; false to disable it.
*
* @return void
*/
public function setAutoCommit($autoCommit)
{
......
......@@ -383,7 +383,7 @@ class Connection implements DriverConnection
*
* @throws DBALException If an invalid platform was specified for this connection.
*/
private function detectDatabasePlatform()
private function detectDatabasePlatform() : void
{
$version = $this->getDatabasePlatformVersion();
......@@ -504,6 +504,8 @@ class Connection implements DriverConnection
* @see isAutoCommit
*
* @param bool $autoCommit True to enable auto-commit mode; false to disable it.
*
* @return void
*/
public function setAutoCommit($autoCommit)
{
......@@ -1316,7 +1318,7 @@ class Connection implements DriverConnection
/**
* Commits all current nesting transactions.
*/
private function commitAll()
private function commitAll() : void
{
while ($this->transactionNestingLevel !== 0) {
if ($this->autoCommit === false && $this->transactionNestingLevel === 1) {
......@@ -1334,6 +1336,8 @@ class Connection implements DriverConnection
/**
* Cancels any database changes done during the current transaction.
*
* @return bool
*
* @throws ConnectionException If the rollback operation failed.
*/
public function rollBack()
......@@ -1373,6 +1377,8 @@ class Connection implements DriverConnection
$this->isRollbackOnly = true;
--$this->transactionNestingLevel;
}
return true;
}
/**
......
......@@ -222,7 +222,7 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
* @throws MysqliException When one of of the options is not supported.
* @throws MysqliException When applying doesn't work - e.g. due to incorrect value.
*/
private function setDriverOptions(array $driverOptions = [])
private function setDriverOptions(array $driverOptions = []) : void
{
$supportedDriverOptions = [
MYSQLI_OPT_CONNECT_TIMEOUT,
......@@ -281,7 +281,7 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
*
* @throws MysqliException
*/
private function setSecureConnection(array $params)
private function setSecureConnection(array $params) : void
{
if (! isset($params['ssl_key']) &&
! isset($params['ssl_cert']) &&
......
......@@ -207,7 +207,7 @@ class MysqliStatement implements IteratorAggregate, Statement
/**
* Binds parameters with known types previously bound to the statement
*/
private function bindTypedParameters()
private function bindTypedParameters() : void
{
$streams = $values = [];
$types = $this->types;
......@@ -245,7 +245,7 @@ class MysqliStatement implements IteratorAggregate, Statement
*
* @throws MysqliException
*/
private function sendLongData($streams)
private function sendLongData($streams) : void
{
foreach ($streams as $paramNr => $stream) {
while (! feof($stream)) {
......
......@@ -12,6 +12,8 @@ class LastInsertId
/**
* @param int $id
*
* @return void
*/
public function setId($id)
{
......
......@@ -156,6 +156,8 @@ abstract class AbstractPlatform
/**
* Sets the EventManager used by the Platform.
*
* @return void
*/
public function setEventManager(EventManager $eventManager)
{
......@@ -391,6 +393,8 @@ abstract class AbstractPlatform
* @param string $dbType
* @param string $doctrineType
*
* @return void
*
* @throws DBALException If the type is not found.
*/
public function registerDoctrineTypeMapping($dbType, $doctrineType)
......@@ -3291,6 +3295,8 @@ abstract class AbstractPlatform
/**
* @deprecated
*
* @return string
*
* @todo Remove in 3.0
*/
public function getIdentityColumnNullInsertSQL()
......
......@@ -628,7 +628,7 @@ class DB2Platform extends AbstractPlatform
* @param string[] $sql The sequence of table alteration statements to fill.
* @param mixed[] $queryParts The sequence of column alteration clauses to fill.
*/
private function gatherAlterColumnSQL(Identifier $table, ColumnDiff $columnDiff, array &$sql, array &$queryParts)
private function gatherAlterColumnSQL(Identifier $table, ColumnDiff $columnDiff, array &$sql, array &$queryParts) : void
{
$alterColumnClauses = $this->getAlterColumnClausesSQL($columnDiff);
......
......@@ -435,7 +435,8 @@ class DrizzlePlatform extends AbstractPlatform
}
/**
* {@inheritDoc}
*
* @return string
*/
protected function getDropPrimaryKeySQL($table)
{
......
......@@ -37,6 +37,8 @@ class OraclePlatform extends AbstractPlatform
*
* @param string $identifier
*
* @return void
*
* @throws DBALException
*/
public static function assertValidIdentifier($identifier)
......@@ -59,7 +61,8 @@ class OraclePlatform extends AbstractPlatform
}
/**
* {@inheritDoc}
*
* @return string
*/
public function getNowExpression($type = 'timestamp')
{
......
......@@ -69,6 +69,8 @@ class PostgreSqlPlatform extends AbstractPlatform
* Enables use of 'true'/'false' or otherwise 1 and 0 instead.
*
* @param bool $flag
*
* @return void
*/
public function setUseBooleanTrueFalseStrings($flag)
{
......
......@@ -222,7 +222,8 @@ class SqlitePlatform extends AbstractPlatform
}
/**
* {@inheritDoc}
*
* @return string
*/
public function getTinyIntTypeDeclarationSql(array $field)
{
......@@ -248,7 +249,8 @@ class SqlitePlatform extends AbstractPlatform
}
/**
* {@inheritDoc}
*
* @return string
*/
public function getMediumIntTypeDeclarationSql(array $field)
{
......
......@@ -1174,7 +1174,7 @@ class QueryBuilder
*
* @throws QueryException
*/
private function verifyAllAliasesAreKnown(array $knownAliases)
private function verifyAllAliasesAreKnown(array $knownAliases) : void
{
foreach ($this->sqlParts['join'] as $fromAlias => $joins) {
if (! isset($knownAliases[$fromAlias])) {
......
......@@ -178,7 +178,8 @@ class DB2SchemaManager extends AbstractSchemaManager
}
/**
* {@inheritdoc}
*
* @return string|null
*/
protected function _getPortableForeignKeyRuleDef($def)
{
......
......@@ -47,6 +47,8 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
* Starts a database.
*
* @param string $database The name of the database to start.
*
* @return void
*/
public function startDatabase($database)
{
......@@ -58,6 +60,8 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
* Stops a database.
*
* @param string $database The name of the database to stop.
*
* @return void
*/
public function stopDatabase($database)
{
......
......@@ -223,9 +223,9 @@ class SqliteSchemaManager extends AbstractSchemaManager
}
/**
* {@inheritdoc}
*
* @deprecated
*
* @return array<string, bool|string>
*/
protected function _getPortableTableIndexDefinition($tableIndex)
{
......
......@@ -20,6 +20,8 @@ abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
/**
* @param string[] $sql
*
* @return void
*/
protected function processSqlSafely(array $sql)
{
......@@ -33,6 +35,8 @@ abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
/**
* @param string[] $sql
*
* @return void
*/
protected function processSql(array $sql)
{
......
......@@ -300,6 +300,8 @@ class Table extends AbstractAsset
* @param string $oldColumnName
* @param string $newColumnName
*
* @return void
*
* @throws DBALException
*/
public function renameColumn($oldColumnName, $newColumnName)
......
......@@ -11,6 +11,8 @@ interface NamespaceVisitor
* Accepts a schema namespace name.
*
* @param string $namespaceName The schema namespace name to accept.
*
* @return void
*/
public function acceptNamespace($namespaceName);
}
......@@ -14,26 +14,37 @@ interface SchemaDiffVisitor
{
/**
* Visit an orphaned foreign key whose table was deleted.
*
* @return void
*/
public function visitOrphanedForeignKey(ForeignKeyConstraint $foreignKey);
/**
* Visit a sequence that has changed.
*
* @return void
*/
public function visitChangedSequence(Sequence $sequence);
/**
* Visit a sequence that has been removed.
*
* @return void
*/
public function visitRemovedSequence(Sequence $sequence);
/** @return void */
public function visitNewSequence(Sequence $sequence);
/** @return void */
public function visitNewTable(Table $table);
/** @return void */
public function visitNewTableForeignKey(Table $table, ForeignKeyConstraint $foreignKey);
/** @return void */
public function visitRemovedTable(Table $table);
/** @return void */
public function visitChangedTable(TableDiff $tableDiff);
}
......@@ -28,9 +28,7 @@ use function sprintf;
*/
class ImportCommand extends Command
{
/**
* {@inheritdoc}
*/
/** @return void */
protected function configure()
{
$this
......
......@@ -66,9 +66,7 @@ class ReservedWordsCommand extends Command
$this->keywordListClasses[$name] = $class;
}
/**
* {@inheritdoc}
*/
/** @return void */
protected function configure()
{
$this
......
......@@ -21,9 +21,7 @@ use function stripos;
*/
class RunSqlCommand extends Command
{
/**
* {@inheritdoc}
*/
/** @return void */
protected function configure()
{
$this
......
......@@ -63,6 +63,8 @@ class ConsoleRunner
/**
* Prints the instructions to create a configuration file
*
* @return void
*/
public static function printCliConfigTemplate()
{
......
......@@ -90,6 +90,9 @@ class ConversionException extends DBALException
), 0, $previous);
}
/**
* @return ConversionException
*/
public static function conversionFailedSerialization($value, $format, $error)
{
$actualType = is_object($value) ? get_class($value) : gettype($value);
......
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