-
-
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.
Improve consistency of exception message formatting.
- Loading branch information
Showing
87 changed files
with
611 additions
and
247 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
16 changes: 16 additions & 0 deletions
16
lib/Doctrine/DBAL/Driver/Mysqli/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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Driver\Mysqli\Exception; | ||
|
||
use Doctrine\DBAL\Driver\Mysqli\MysqliException; | ||
use mysqli; | ||
|
||
final class ConnectionError extends MysqliException | ||
{ | ||
public static function new(mysqli $connection) : self | ||
{ | ||
return new self($connection->error, $connection->sqlstate ?: null, $connection->errno); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
lib/Doctrine/DBAL/Driver/Mysqli/Exception/FailedReadingStreamOffset.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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Driver\Mysqli\Exception; | ||
|
||
use Doctrine\DBAL\Driver\Mysqli\MysqliException; | ||
use function sprintf; | ||
|
||
final class FailedReadingStreamOffset extends MysqliException | ||
{ | ||
public static function new(int $offset) : self | ||
{ | ||
return new self(sprintf('Failed reading the stream resource for parameter offset %d.', $offset)); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
lib/Doctrine/DBAL/Driver/Mysqli/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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Driver\Mysqli\Exception; | ||
|
||
use Doctrine\DBAL\Driver\Mysqli\MysqliException; | ||
use mysqli_stmt; | ||
|
||
final class StatementError extends MysqliException | ||
{ | ||
public static function new(mysqli_stmt $statement) : self | ||
{ | ||
return new self($statement->error, $statement->sqlstate ?: null, $statement->errno); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
lib/Doctrine/DBAL/Driver/Mysqli/Exception/UnknownFetchMode.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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Driver\Mysqli\Exception; | ||
|
||
use Doctrine\DBAL\Driver\Mysqli\MysqliException; | ||
use function sprintf; | ||
|
||
final class UnknownFetchMode extends MysqliException | ||
{ | ||
/** | ||
* @param mixed $fetchMode | ||
*/ | ||
public static function new($fetchMode) : self | ||
{ | ||
return new self(sprintf('Unknown fetch mode %d.', $fetchMode)); | ||
} | ||
} |
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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Driver\Mysqli\Exception; | ||
|
||
use Doctrine\DBAL\Driver\Mysqli\MysqliException; | ||
use function sprintf; | ||
|
||
final class UnknownType extends MysqliException | ||
{ | ||
/** | ||
* @param mixed $type | ||
*/ | ||
public static function new($type) : self | ||
{ | ||
return new self(sprintf('Unknown type, %d given.', $type)); | ||
} | ||
} |
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
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.