<?php

namespace AutoAdmin\Bundle\Admin\Form\TypeGuesser\Guesser\Relation;

use Doctrine\ORM\Mapping\OneToOne;

class OneToOneRelationGuesser extends AbstractAdminRelationTypeGuesser
{
    public function getRelationType(): string
    {
        return OneToOne::class;
    }

    public function getMatchingConfigStrings(): array
    {
        return [
            'one-to-one',
            'one_to_one',
            'oneToOne',
            'entity-one-to-one',
            'entity_one_to_one',
            'entityOneToOne',
            'entity',
        ];
    }

    public function getDefaultRelationFormTypeOptions(): array
    {
        return [
            'multiple' => false,
            'expanded' => false,
        ];
    }

    public function getMatchingPropertyTypes(): array
    {
        return [
            $this->getTargetEntity(),
            'object',
        ];
    }

    public function priority(): int
    {
        return 10;
    }
}
