<?php

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

use Doctrine\ORM\Mapping\ManyToMany;

class ManyToManyRelationGuesser extends AbstractAdminRelationTypeGuesser
{
    public function getRelationType(): string
    {
        return ManyToMany::class;
    }

    public function getMatchingConfigStrings(): array
    {
        return [
            'many-to-many',
            'many_to_many',
            'manyToMany',
            'entity-many-to-many',
            'entity_many_to_many',
            'entityManyToMany',
            'entity',
        ];
    }

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

    public function getMatchingPropertyTypes(): array
    {
        return [
            'Collection',
            'array',
        ];
    }

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