<?php

declare(strict_types=1);

namespace Apexl\Io\Services;

/**
 * Normalises a dotted field path into the finder's relation-field form:
 * `contact.name` becomes `contact__name`, which LoaderArgumentResolver::resolveRelations()
 * then splits back apart to group fields by relation.
 */
final readonly class RelationFieldRenamer
{
    public function rename(string $field): string
    {
        return str_replace('.', '__', $field);
    }
}