Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark every exception as immutable #3964

Merged
merged 1 commit into from
Apr 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/Doctrine/DBAL/Cache/CacheException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Doctrine\DBAL\DBALException;

/**
* @psalm-immutable
*/
class CacheException extends DBALException
{
/**
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/DBAL/ConnectionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace Doctrine\DBAL;

/**
* @psalm-immutable
*/
class ConnectionException extends DBALException
{
/**
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/DBAL/DBALException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
use function spl_object_hash;
use function sprintf;

/**
* @psalm-immutable
*/
class DBALException extends Exception
{
/**
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Exception;

/**
* @psalm-immutable
*/
class DB2Exception extends Exception
{
}
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/ConnectionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Base class for all connection related errors detected in the driver.
*
* @psalm-immutable
*/
class ConnectionException extends DriverException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/ConstraintViolationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Base class for all constraint violation related errors detected in the driver.
*
* @psalm-immutable
*/
class ConstraintViolationException extends ServerException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/DatabaseObjectExistsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* 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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* 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
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/DeadlockException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Exception for a deadlock error of a transaction detected in the driver.
*
* @psalm-immutable
*/
class DeadlockException extends ServerException implements RetryableException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/DriverException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

/**
* Base class for all errors detected in the driver.
*
* @psalm-immutable
*/
class DriverException extends DBALException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Exception for a foreign key constraint violation detected in the driver.
*
* @psalm-immutable
*/
class ForeignKeyConstraintViolationException extends ConstraintViolationException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/**
* Exception to be thrown when invalid arguments are passed to any DBAL API
*
* @psalm-immutable
*/
class InvalidArgumentException extends DBALException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/InvalidFieldNameException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Exception for an invalid specified field name in a statement detected in the driver.
*
* @psalm-immutable
*/
class InvalidFieldNameException extends ServerException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/LockWaitTimeoutException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Exception for a lock wait timeout error of a transaction detected in the driver.
*
* @psalm-immutable
*/
class LockWaitTimeoutException extends ServerException implements RetryableException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/NonUniqueFieldNameException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Exception for a non-unique/ambiguous specified field name in a statement detected in the driver.
*
* @psalm-immutable
*/
class NonUniqueFieldNameException extends ServerException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Exception for a NOT NULL constraint violation detected in the driver.
*
* @psalm-immutable
*/
class NotNullConstraintViolationException extends ConstraintViolationException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/ReadOnlyException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Exception for a write operation attempt on a read-only database element detected in the driver.
*
* @psalm-immutable
*/
class ReadOnlyException extends ServerException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/ServerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Base class for all server related errors detected in the driver.
*
* @psalm-immutable
*/
class ServerException extends DriverException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/SyntaxErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Exception for a syntax error in a statement detected in the driver.
*
* @psalm-immutable
*/
class SyntaxErrorException extends ServerException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/TableExistsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Exception for an already existing table referenced in a statement detected in the driver.
*
* @psalm-immutable
*/
class TableExistsException extends DatabaseObjectExistsException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Exception/TableNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Exception for an unknown table referenced in a statement detected in the driver.
*
* @psalm-immutable
*/
class TableNotFoundException extends DatabaseObjectNotFoundException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* Exception for a unique constraint violation detected in the driver.
*
* @psalm-immutable
*/
class UniqueConstraintViolationException extends ConstraintViolationException
{
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/DBAL/Query/QueryException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use Doctrine\DBAL\DBALException;
use function implode;

/**
* @psalm-immutable
*/
class QueryException extends DBALException
{
/**
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/SQLParserUtilsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/**
* Doctrine\DBAL\ConnectionException
*
* @psalm-immutable
*/
class SQLParserUtilsException extends DBALException
{
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/DBAL/Schema/SchemaException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use function implode;
use function sprintf;

/**
* @psalm-immutable
*/
class SchemaException extends DBALException
{
public const TABLE_DOESNT_EXIST = 10;
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Sharding/ShardingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/**
* Sharding related Exceptions
*
* @psalm-immutable
*/
class ShardingException extends DBALException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Types/ConversionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

/**
* Conversion Exception is thrown when the database to PHP conversion fails.
*
* @psalm-immutable
*/
class ConversionException extends DBALException
{
Expand Down