final class RowMaterializer

Walks the relations needed to materialize one connected fixture group.

Methods§

public function __construct(
    private SchemaResolverInterface $schemas,
    private RowGeneration $generator,
    private Generator $faker,
)

Uses one schema registry, row generator and random source for the walk.

Parameters

$schemasSchemaResolverInterface
$generatorRowGeneration
$fakerGenerator
public function materializeParent(
    FixturePlan $plan,
    string $table,
    bool $isList,
    Relation $arrivedBy,
    GenerationRun $run,
): array<string, mixed>

Generate the single row a relation points at.

Parameters

$planFixturePlan
$tablestring
$isListbool
$arrivedByRelation
$runGenerationRun

Returns

array<string, mixed>
Test cases 1
Called from 1
Calls 2
public function materializeRow(
    FixturePlan $plan,
    TableSchema $schema,
    array<mixed> $inherited,
    RowSpec $spec,
    int $index,
    bool $isList,
    ?Relation $arrivedBy,
    GenerationRun $run,
): void
public function toParent(
    FixturePlan $plan,
    Relation $relation,
    array<mixed> $overrides,
    bool $isList,
    GenerationRun $run,
): array<string, mixed>

Generate the one row this one references and read the linking columns off it.

Where the caller has already fixed every linking column they have said what the row references, so no parent is invented to contradict them.

Parameters

$planFixturePlan
$relationRelation
$overridesarray<mixed>
$isListbool
$runGenerationRun

Returns

array<string, mixed>
Test cases 1
Called from 1
Calls 7

Private surface 3§

Implementation details, listed for orientation only.

private SchemaResolverInterface $schemas
private RowGeneration $generator
private Generator $faker

Test cases 10§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5
Other tests reaching this symbol 5

Relations§

Instantiated in 1
Method calls 1