Lines 100.00% 1 / 1
Functions and Methods 100.00% 1 / 1
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
LiveTable 100.00% 1 / 1 100.00% 1 / 1 1 100.00% 1 / 1
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace BlueprintAU\Radiant\Database\Schema\Inspectors;
6
7/**
8 * The live schema of one table, as the differ sees it.
9 *
10 * A dialect-neutral snapshot — the differ compares this against the
11 * desired-state {@see \BlueprintAU\Radiant\Database\Schema\Blueprint}
12 * without knowing which dialect produced it.
13 */
14final class LiveTable
15{
16    /**
17     * Create a live-table snapshot.
18     *
19     * @param  string  $name
20     * @param  list<array{name: string, type: string, nullable: bool, default: mixed, primaryKey: bool}>  $columns
21     * @param  list<array{name: string|null, columns: list<string>, unique: bool, where: string|null, nullsNotDistinct: bool}>  $indexes
22     * @param  list<array{columns: list<string>, referencesTable: string, referencesColumns: list<string>, onDelete: string|null, onUpdate: string|null, deferrable: bool, name?: string|null}>  $foreignKeys
23     * @param  list<array{name: string|null, expression: string|null}>  $checks
24     */
25    public function __construct(
26        public readonly string $name,
27        public readonly array $columns,
28        public readonly array $indexes = [],
29        public readonly array $foreignKeys = [],
30        public readonly array $checks = [],
31    ) {
32    }
33}