Skip to content

Commit

Permalink
Add missing @throws DBALException
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Jul 10, 2020
1 parent 2494d9b commit 2efcbe2
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Connection.php
Expand Up @@ -401,6 +401,8 @@ private function getDatabasePlatformVersion()
* Returns the database server version if the underlying driver supports it.
*
* @return string|null
*
* @throws DBALException
*/
private function getServerVersion()
{
Expand Down Expand Up @@ -626,6 +628,8 @@ public function close()
* @param int $level The level to set.
*
* @return int
*
* @throws DBALException
*/
public function setTransactionIsolation($level)
{
Expand All @@ -638,6 +642,8 @@ public function setTransactionIsolation($level)
* Gets the currently active transaction isolation level.
*
* @return int The current transaction isolation level.
*
* @throws DBALException
*/
public function getTransactionIsolation()
{
Expand Down Expand Up @@ -1226,6 +1232,8 @@ protected function _getNestedTransactionSavePointName()

/**
* @return bool
*
* @throws DBALException
*/
public function beginTransaction()
{
Expand Down Expand Up @@ -1314,6 +1322,8 @@ public function commit()

/**
* Commits all current nesting transactions.
*
* @throws DBALException
*/
private function commitAll(): void
{
Expand Down Expand Up @@ -1442,6 +1452,8 @@ public function rollbackSavepoint($savepoint)
* Gets the wrapped driver connection.
*
* @return DriverConnection
*
* @throws DBALException
*/
public function getWrappedConnection()
{
Expand Down Expand Up @@ -1513,6 +1525,8 @@ public function isRollbackOnly()
* @param string $type The name of the DBAL mapping type.
*
* @return mixed The converted value.
*
* @throws DBALException
*/
public function convertToDatabaseValue($value, $type)
{
Expand All @@ -1527,6 +1541,8 @@ public function convertToDatabaseValue($value, $type)
* @param string $type The name of the DBAL mapping type.
*
* @return mixed The converted type.
*
* @throws DBALException
*/
public function convertToPHPValue($value, $type)
{
Expand All @@ -1540,6 +1556,8 @@ public function convertToPHPValue($value, $type)
* @param DriverStatement $stmt The statement to bind the values to.
* @param mixed[] $params The map/list of named/positional parameters.
* @param int[]|string[] $types The parameter types (PDO binding types or DBAL mapping types).
*
* @throws DBALException
*/
private function _bindTypedValues(DriverStatement $stmt, array $params, array $types): void
{
Expand Down Expand Up @@ -1581,6 +1599,8 @@ private function _bindTypedValues(DriverStatement $stmt, array $params, array $t
* @param int|string|null $type The type to bind (PDO or DBAL).
*
* @return mixed[] [0] => the (escaped) value, [1] => the binding type.
*
* @throws DBALException
*/
private function getBindingInfo($value, $type)
{
Expand Down
1 change: 1 addition & 0 deletions src/Connections/PrimaryReadReplicaConnection.php
Expand Up @@ -98,6 +98,7 @@ class PrimaryReadReplicaConnection extends Connection
*
* @param mixed[] $params
*
* @throws DBALException
* @throws InvalidArgumentException
*/
public function __construct(array $params, Driver $driver, ?Configuration $config = null, ?EventManager $eventManager = null)
Expand Down
2 changes: 2 additions & 0 deletions src/Driver/PDO/Connection.php
Expand Up @@ -60,6 +60,8 @@ public function getServerVersion()
}

/**
* {@inheritDoc}
*
* @return Statement
*/
public function prepare(string $sql): StatementInterface
Expand Down
3 changes: 3 additions & 0 deletions src/Event/Listeners/OracleSessionInit.php
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\DBAL\Event\Listeners;

use Doctrine\Common\EventSubscriber;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Event\ConnectionEventArgs;
use Doctrine\DBAL\Events;

Expand Down Expand Up @@ -44,6 +45,8 @@ public function __construct(array $oracleSessionVars = [])

/**
* @return void
*
* @throws DBALException
*/
public function postConnect(ConnectionEventArgs $args)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Platforms/AbstractPlatform.php
Expand Up @@ -2165,6 +2165,8 @@ public function getColumnDeclarationListSQL(array $fields)
* a string that defines the complete column
*
* @return string DBMS specific SQL code portion that should be used to declare the column.
*
* @throws DBALException
*/
public function getColumnDeclarationSQL($name, array $field)
{
Expand Down
5 changes: 5 additions & 0 deletions src/Platforms/MySqlPlatform.php
Expand Up @@ -2,6 +2,7 @@

namespace Doctrine\DBAL\Platforms;

use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use Doctrine\DBAL\Schema\Identifier;
use Doctrine\DBAL\Schema\Index;
Expand Down Expand Up @@ -694,6 +695,8 @@ protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff)

/**
* @return string[]
*
* @throws DBALException
*/
private function getPreAlterTableAlterPrimaryKeySQL(TableDiff $diff, Index $index)
{
Expand Down Expand Up @@ -733,6 +736,8 @@ private function getPreAlterTableAlterPrimaryKeySQL(TableDiff $diff, Index $inde
* @param TableDiff $diff The table diff to gather the SQL for.
*
* @return string[]
*
* @throws DBALException
*/
private function getPreAlterTableAlterIndexForeignKeySQL(TableDiff $diff)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Platforms/SqlitePlatform.php
Expand Up @@ -963,6 +963,8 @@ public function getAlterTableSQL(TableDiff $diff)

/**
* @return string[]|false
*
* @throws DBALException
*/
private function getSimpleAlterTableSQL(TableDiff $diff)
{
Expand Down
3 changes: 3 additions & 0 deletions src/Query/QueryBuilder.php
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\DBAL\Query;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\Result;
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Query\Expression\CompositeExpression;
Expand Down Expand Up @@ -202,6 +203,8 @@ public function getState()
* for insert, update and delete statements.
*
* @return Result|int
*
* @throws DBALException
*/
public function execute()
{
Expand Down

0 comments on commit 2efcbe2

Please sign in to comment.