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
PropertyMapping 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\Metadata;
6
7use BlueprintAU\Radiant\Attributes\Column;
8use BlueprintAU\Radiant\Model;
9
10/**
11 * One column's resolved metadata: the property, its DB column, and who owns it.
12 *
13 * @property class-string<Model> $owner
14 */
15final class PropertyMapping
16{
17    /**
18     * Create a property mapping.
19     *
20     * @param  string  $propertyName
21     * @param  string  $columnName
22     * @param  Column  $column
23     * @param  \ReflectionProperty|null  $property
24     * @param  string  $owner
25     * @param  string|null  $propertyType
26     * @param  mixed  $backfill  The #[Backfill] value for the column's add, or null when none is declared.
27     */
28    public function __construct(
29        public readonly string $propertyName,
30        public readonly string $columnName,
31        public readonly Column $column,
32        public readonly \ReflectionProperty|null $property,
33        public readonly string $owner,
34        public readonly string|null $propertyType = null,
35        public readonly mixed $backfill = null,
36    ) {
37    }
38}