Skip to content

resolve() other class definitions to a NonCheckedClassType

Jiří Pudil requested to merge resolve-class-definitions into master

Before:

return [
    (new ClassDefinitionBuilder(Item::class))
        ->build(),
    (new ClassDefinitionBuilder(Collection::class))
        ->field('items', listOf(classType(Item::class))) // ←
        ->build(),
];

After:

return [
    // ↓
    $item = (new ClassDefinitionBuilder(Item::class))
        ->build(),
    (new ClassDefinitionBuilder(Collection::class))
        ->field('items', listOf($item)) // ←
        ->build(),
];

Merge request reports

Loading