src/StringTranslatorAwareTrait.php
protected function _setTranslator($translator)
    {
        if (!(is_null($translator) || $translator instanceof StringTranslatorInterface)) {
            throw new InvalidArgumentException('Invalid translator');
        }

        $this->translator = $translator;

        return $this;
    }
protected function _setTranslator($translator)
    {
        if (!(is_null($translator) || $translator instanceof StringTranslatorInterface)) {
            throw new InvalidArgumentException('Invalid translator');
        }

        $this->translator = $translator;

        return $this;
    }
protected function _setTranslator ( $ translator ) { if ( ! ( is_null ( $ translator ) || $ translator instanceof StringTranslatorInterface ) ) { throw new InvalidArgumentException ( 'Invalid translator' ) ; } $ this -> translator = $ translator ; return $ this ; }
Assigns the translator to be used by this instance.

@since [*next-version*]

@param StringTranslatorInterface|null $translator The translator.

@throws InvalidArgumentException If translator is invalid.

@return $this
Assigns the translator to be used by this instance .