<commit_before><?php

namespace Balance\InputFilter;

use Zend\Filter;
use Zend\InputFilter\Input;
use Zend\InputFilter\InputFilter;
use Zend\Validator;

/**
 * Validação de Dados de Conta
 */
class Accounts extends InputFilter
{
    /**
     * {@inheritdoc}
     */
    public function init()
    {
        // Chave Primária
        $input = new Input('id');
        $input->getFilterChain()
            ->attach(new Filter\ToInt());
        $this->add($input);

        // Tipo
        $input = new Input('type');
        $input->getValidatorChain()
            ->attach(new Validator\InArray(array('haystack' => array('ACTIVE', 'PASSIVE'))));
        $this->add($input);

        // Nome
        $this->add(new Input('name'));

        // Descrição
        $this->add(new Input('description'));
    }
}<commit_msg>Issue #57 Correção conforme solicitado em tarefa.<commit_after><?php

namespace Balance\InputFilter;

use Balance\Model\AccountType;
use Zend\Filter;
use Zend\InputFilter\Input;
use Zend\InputFilter\InputFilter;
use Zend\Validator;

/**
 * Validação de Dados de Conta
 */
class Accounts extends InputFilter
{
    /**
     * {@inheritdoc}
     */
    public function init()
    {
        // Chave Primária
        $input = new Input('id');
        $input->getFilterChain()
            ->attach(new Filter\ToInt());
        $this->add($input);

        // Tipo
        $input = new Input('type');
        $input->getValidatorChain()
            ->attach(new Validator\InArray(array('haystack' => array_keys((new AccountType())->getDefinition()))));
        $this->add($input);

        // Nome
        $this->add(new Input('name'));

        // Descrição
        $this->add(new Input('description'));
    }
}
{'fraction_non_alphanumeric': 0.15902495647127105, 'fraction_numerical': 0.0011607661056297156, 'mean_word_length': 2.387033398821218, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3102330', 'n_tokens_mistral': 535, 'n_tokens_neox': 516, 'n_words': 106}