Skip to content

Commit

Permalink
Mark exceptions as immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Apr 15, 2020
1 parent 45ca637 commit 6c78851
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 5 deletions.
5 changes: 0 additions & 5 deletions baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
<code>int</code>
</InvalidParamDefault>
</file>
<file src="lib/Doctrine/DBAL/Driver/DriverException.php">
<MissingImmutableAnnotation occurrences="1">
<code>public function getMessage();</code>
</MissingImmutableAnnotation>
</file>
<file src="lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereConnection.php">
<UndefinedFunction occurrences="14">
<code>sasql_pconnect($dsn)</code>
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Driver/AbstractDriverException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/**
* Abstract base implementation of the {@link DriverException} interface.
*
* @psalm-immutable
*/
abstract class AbstractDriverException extends Exception implements DriverException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Driver/DriverException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*
* Driver exceptions provide the SQLSTATE of the driver
* and the driver specific error code at the time the error occurred.
*
* @psalm-immutable
*/
interface DriverException extends Throwable
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/**
* Exception thrown in case the mysqli driver errors.
*
* @psalm-immutable
*/
class MysqliException extends AbstractDriverException
{
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Doctrine\DBAL\Driver\AbstractDriverException;

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

/**
* Tiny wrapper for PDOException instances to implement the {@link DriverException} interface.
*
* @psalm-immutable
*/
class PDOException extends \PDOException implements DriverException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

/**
* SAP Sybase SQL Anywhere driver exception.
*
* @psalm-immutable
*/
class SQLAnywhereException extends AbstractDriverException
{
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use function rtrim;
use function sqlsrv_errors;

/**
* @psalm-immutable
*/
class SQLSrvException extends AbstractDriverException
{
/**
Expand Down

0 comments on commit 6c78851

Please sign in to comment.