src/Validator/Required.php
public function isValid($value)
    {
        $this->resetMessages();

        $this->value = $value;

        if (
            $value === null ||
            (is_string($value) && trim($value) === '')
        ) {
            $this->addMessage();

            return false;
        }

        return true;
    }
public function isValid($value)
    {
        $this->resetMessages();

        $this->value = $value;

        if (
            $value === null ||
            (is_string($value) && trim($value) === '')
        ) {
            $this->addMessage();

            return false;
        }

        return true;
    }
{@inheritdoc}