<?php

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

use AutoAdmin\Bundle\Admin\Form\TypeGuesser\AbstractAdminTypeGuesser;
use Doctrine\DBAL\Types\Types;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;

class IntegerGuesser extends AbstractAdminTypeGuesser
{
    public function getFormType(): string
    {
        return IntegerType::class;
    }

    public function getDefaultFormTypeOptions(): array
    {
        return [];
    }

    public function getMatchingConfigStrings(): array
    {
        return [
            'integer',
            'int'
        ];
    }

    public function getMatchingAttributes(): array
    {
        return [
            Types::SMALLINT,
            Types::INTEGER,
            Types::BIGINT,
        ];
    }

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

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