-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The IBM DB2 driver Exception class must implement the DriverException…
… interface
- Loading branch information
Showing
11 changed files
with
217 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
lib/Doctrine/DBAL/Driver/IBMDB2/Exception/ConnectionError.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Driver\IBMDB2\Exception; | ||
|
||
use Doctrine\DBAL\Driver\IBMDB2\DB2Exception; | ||
|
||
use function db2_conn_error; | ||
use function db2_conn_errormsg; | ||
|
||
/** | ||
* @psalm-immutable | ||
*/ | ||
final class ConnectionError extends DB2Exception | ||
{ | ||
/** | ||
* @param resource $connection | ||
*/ | ||
public static function new($connection): self | ||
{ | ||
return new self(db2_conn_errormsg($connection), db2_conn_error($connection)); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
lib/Doctrine/DBAL/Driver/IBMDB2/Exception/ConnectionFailed.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Driver\IBMDB2\Exception; | ||
|
||
use Doctrine\DBAL\Driver\IBMDB2\DB2Exception; | ||
|
||
use function db2_conn_error; | ||
use function db2_conn_errormsg; | ||
|
||
/** | ||
* @psalm-immutable | ||
*/ | ||
final class ConnectionFailed extends DB2Exception | ||
{ | ||
public static function new(): self | ||
{ | ||
return new self(db2_conn_errormsg(), db2_conn_error()); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
lib/Doctrine/DBAL/Driver/IBMDB2/Exception/PrepareFailed.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Driver\IBMDB2\Exception; | ||
|
||
use Doctrine\DBAL\Driver\IBMDB2\DB2Exception; | ||
|
||
/** | ||
* @psalm-immutable | ||
*/ | ||
final class PrepareFailed extends DB2Exception | ||
{ | ||
public static function new(string $message): self | ||
{ | ||
return new self($message); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
lib/Doctrine/DBAL/Driver/IBMDB2/Exception/StatementError.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Driver\IBMDB2\Exception; | ||
|
||
use Doctrine\DBAL\Driver\IBMDB2\DB2Exception; | ||
|
||
use function db2_stmt_error; | ||
use function db2_stmt_errormsg; | ||
|
||
/** | ||
* @psalm-immutable | ||
*/ | ||
final class StatementError extends DB2Exception | ||
{ | ||
/** | ||
* @param resource $statement | ||
*/ | ||
public static function new($statement): self | ||
{ | ||
return new self(db2_stmt_errormsg($statement), db2_stmt_error($statement)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.