protected static function addValidators(InputInterface $input, array $data)
    {
        $hasValidators = isset($data['validates']) && is_array($data['validates']);
        if (! $hasValidators) {
            return;
        }

        foreach ($data['validates'] as $validator => $message) {
            self::checkIfRequired($validator, $input);
            if (!is_array($message)) {
                $message = ['message' => $message];
            }
            $message['form'] = self::$form;
            $input->addValidator($validator, $message);
        }
    }