diff options
Diffstat (limited to 'vendor/doctrine/dbal/src/Exception/NoKeyValue.php')
| -rw-r--r-- | vendor/doctrine/dbal/src/Exception/NoKeyValue.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/vendor/doctrine/dbal/src/Exception/NoKeyValue.php b/vendor/doctrine/dbal/src/Exception/NoKeyValue.php new file mode 100644 index 0000000..5cea11d --- /dev/null +++ b/vendor/doctrine/dbal/src/Exception/NoKeyValue.php | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\DBAL\Exception; | ||
| 6 | |||
| 7 | use Doctrine\DBAL\Exception; | ||
| 8 | |||
| 9 | use function sprintf; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @internal | ||
| 13 | * | ||
| 14 | * @psalm-immutable | ||
| 15 | */ | ||
| 16 | final class NoKeyValue extends \Exception implements Exception | ||
| 17 | { | ||
| 18 | public static function fromColumnCount(int $columnCount): self | ||
| 19 | { | ||
| 20 | return new self( | ||
| 21 | sprintf( | ||
| 22 | 'Fetching as key-value pairs requires the result to contain at least 2 columns, %d given.', | ||
| 23 | $columnCount, | ||
| 24 | ), | ||
| 25 | ); | ||
| 26 | } | ||
| 27 | } | ||
