Unverified Commit 50e23218 authored by Sergei Morozov's avatar Sergei Morozov Committed by GitHub

Merge pull request #3964 from greg0ire/moar-immutable-exceptions

Mark every exception as immutable
parents 0686b53c fedac503
......@@ -4,6 +4,9 @@ namespace Doctrine\DBAL\Cache;
use Doctrine\DBAL\DBALException;
/**
* @psalm-immutable
*/
class CacheException extends DBALException
{
/**
......
......@@ -2,6 +2,9 @@
namespace Doctrine\DBAL;
/**
* @psalm-immutable
*/
class ConnectionException extends DBALException
{
/**
......
......@@ -22,6 +22,9 @@ use function preg_replace;
use function spl_object_hash;
use function sprintf;
/**
* @psalm-immutable
*/
class DBALException extends Exception
{
/**
......
......@@ -4,6 +4,9 @@ namespace Doctrine\DBAL\Driver\IBMDB2;
use Exception;
/**
* @psalm-immutable
*/
class DB2Exception extends Exception
{
}
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Base class for all connection related errors detected in the driver.
*
* @psalm-immutable
*/
class ConnectionException extends DriverException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Base class for all constraint violation related errors detected in the driver.
*
* @psalm-immutable
*/
class ConstraintViolationException extends ServerException
{
......
......@@ -8,6 +8,8 @@ namespace Doctrine\DBAL\Exception;
* A database object is considered any asset that can be created in a database
* such as schemas, tables, views, sequences, triggers, constraints, indexes,
* functions, stored procedures etc.
*
* @psalm-immutable
*/
class DatabaseObjectExistsException extends ServerException
{
......
......@@ -8,6 +8,8 @@ namespace Doctrine\DBAL\Exception;
* A database object is considered any asset that can be created in a database
* such as schemas, tables, views, sequences, triggers, constraints, indexes,
* functions, stored procedures etc.
*
* @psalm-immutable
*/
class DatabaseObjectNotFoundException extends ServerException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a deadlock error of a transaction detected in the driver.
*
* @psalm-immutable
*/
class DeadlockException extends ServerException implements RetryableException
{
......
......@@ -7,6 +7,8 @@ use Exception;
/**
* Base class for all errors detected in the driver.
*
* @psalm-immutable
*/
class DriverException extends DBALException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a foreign key constraint violation detected in the driver.
*
* @psalm-immutable
*/
class ForeignKeyConstraintViolationException extends ConstraintViolationException
{
......
......@@ -6,6 +6,8 @@ use Doctrine\DBAL\DBALException;
/**
* Exception to be thrown when invalid arguments are passed to any DBAL API
*
* @psalm-immutable
*/
class InvalidArgumentException extends DBALException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for an invalid specified field name in a statement detected in the driver.
*
* @psalm-immutable
*/
class InvalidFieldNameException extends ServerException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a lock wait timeout error of a transaction detected in the driver.
*
* @psalm-immutable
*/
class LockWaitTimeoutException extends ServerException implements RetryableException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a non-unique/ambiguous specified field name in a statement detected in the driver.
*
* @psalm-immutable
*/
class NonUniqueFieldNameException extends ServerException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a NOT NULL constraint violation detected in the driver.
*
* @psalm-immutable
*/
class NotNullConstraintViolationException extends ConstraintViolationException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a write operation attempt on a read-only database element detected in the driver.
*
* @psalm-immutable
*/
class ReadOnlyException extends ServerException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Base class for all server related errors detected in the driver.
*
* @psalm-immutable
*/
class ServerException extends DriverException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a syntax error in a statement detected in the driver.
*
* @psalm-immutable
*/
class SyntaxErrorException extends ServerException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for an already existing table referenced in a statement detected in the driver.
*
* @psalm-immutable
*/
class TableExistsException extends DatabaseObjectExistsException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for an unknown table referenced in a statement detected in the driver.
*
* @psalm-immutable
*/
class TableNotFoundException extends DatabaseObjectNotFoundException
{
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a unique constraint violation detected in the driver.
*
* @psalm-immutable
*/
class UniqueConstraintViolationException extends ConstraintViolationException
{
......
......@@ -5,6 +5,9 @@ namespace Doctrine\DBAL\Query;
use Doctrine\DBAL\DBALException;
use function implode;
/**
* @psalm-immutable
*/
class QueryException extends DBALException
{
/**
......
......@@ -6,6 +6,8 @@ use function sprintf;
/**
* Doctrine\DBAL\ConnectionException
*
* @psalm-immutable
*/
class SQLParserUtilsException extends DBALException
{
......
......@@ -6,6 +6,9 @@ use Doctrine\DBAL\DBALException;
use function implode;
use function sprintf;
/**
* @psalm-immutable
*/
class SchemaException extends DBALException
{
public const TABLE_DOESNT_EXIST = 10;
......
......@@ -6,6 +6,8 @@ use Doctrine\DBAL\DBALException;
/**
* Sharding related Exceptions
*
* @psalm-immutable
*/
class ShardingException extends DBALException
{
......
......@@ -15,6 +15,8 @@ use function substr;
/**
* Conversion Exception is thrown when the database to PHP conversion fails.
*
* @psalm-immutable
*/
class ConversionException extends DBALException
{
......
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