<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Statistiky\Services\Analyzators\Validators;

/**
 * Class Lexical
 *
 * @package Seka\Portal\Modul\Statistiky\Services\Analyzators\Validators
 */
abstract class Lexical extends Validator
{
    /**
     * @var array
     */
    protected array $tokens;

    /**
     * Lexical constructor.
     */
    public function __construct()
    {
        $this->tokens = array();
    }

    /**
     * @return array
     */
    public function getTokens(): array
    {
        return $this->tokens;
    }

    /**
     * @param $input
     */
    public function validate($input)
    {
        $this->tokens[] = $input;
    }

    /**
     * @param $input
     *
     * @return string
     */
    public function getErrorMsg($input): string
    {
        return sprintf('but "%s" provided.', $input);
    }
}
