summaryrefslogtreecommitdiff
path: root/vendor/doctrine/dbal/src/Exception/NoKeyValue.php
blob: 5cea11d482ffeaf5b463e9b7881a6581d48fc98e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

declare(strict_types=1);

namespace Doctrine\DBAL\Exception;

use Doctrine\DBAL\Exception;

use function sprintf;

/**
 * @internal
 *
 * @psalm-immutable
 */
final class NoKeyValue extends \Exception implements Exception
{
    public static function fromColumnCount(int $columnCount): self
    {
        return new self(
            sprintf(
                'Fetching as key-value pairs requires the result to contain at least 2 columns, %d given.',
                $columnCount,
            ),
        );
    }
}