Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
MissingColumn
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 forColumn
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Celemas\Quma\Exception;
6
7/** @api */
8final class MissingColumn extends HydrationFailure
9{
10    /**
11     * @param class-string $class
12     * @param non-empty-string $parameter
13     * @param non-empty-string $column
14     * @param list<string> $rowKeys
15     */
16    public static function forColumn(
17        string $class,
18        string $parameter,
19        string $column,
20        ?string $sourcePath,
21        array $rowKeys,
22    ): self {
23        return new self(self::message(
24            $class,
25            $sourcePath,
26            "missing required column '{$column}' for parameter '\${$parameter}'. Row keys: "
27            . self::formatRowKeys($rowKeys)
28            . '.',
29        ));
30    }
31}