protected function _dereferenceTokens($value)
    {
        if (is_scalar($value) && !is_string($value)) {
            return $value;
        }

        try {
            $value = $this->_normalizeString($value);
        } catch (InvalidArgumentException $e) {
            return $value;
        }

        $container  = $this->_getContainer();
        $tokenStart = $this->_getTokenStart();
        $tokenEnd   = $this->_getTokenEnd();

        try {
            $value = $this->_replaceReferences($value, $container, null, $tokenStart, $tokenEnd);
        } catch (ContainerExceptionInterface $e) {
            throw $this->_createRuntimeException($this->__('Could not de-reference tokens'), null, $e);
        }

        return $value;
    }
protected function _dereferenceTokens($value)
    {
        if (is_scalar($value) && !is_string($value)) {
            return $value;
        }

        try {
            $value = $this->_normalizeString($value);
        } catch (InvalidArgumentException $e) {
            return $value;
        }

        $container  = $this->_getContainer();
        $tokenStart = $this->_getTokenStart();
        $tokenEnd   = $this->_getTokenEnd();

        try {
            $value = $this->_replaceReferences($value, $container, null, $tokenStart, $tokenEnd);
        } catch (ContainerExceptionInterface $e) {
            throw $this->_createRuntimeException($this->__('Could not de-reference tokens'), null, $e);
        }

        return $value;
    }
protected function _dereferenceTokens ( $ value ) { if ( is_scalar ( $ value ) && ! is_string ( $ value ) ) { return $ value ; } try { $ value = $ this -> _normalizeString ( $ value ) ; } catch ( InvalidArgumentException $ e ) { return $ value ; } $ container = $ this -> _getContainer ( ) ; $ tokenStart = $ this -> _getTokenStart ( ) ; $ tokenEnd = $ this -> _getTokenEnd ( ) ; try { $ value = $ this -> _replaceReferences ( $ value , $ container , null , $ tokenStart , $ tokenEnd ) ; } catch ( ContainerExceptionInterface $ e ) { throw $ this -> _createRuntimeException ( $ this -> __ ( 'Could not de-reference tokens' ) , null , $ e ) ; } return $ value ; }
Replaces tokens with their values.

@since [*next-version*]

@param string|Stringable|mixed $value The value, in which tokens may be found.
If value is not stringable, will return it as is.

@throws RuntimeException If tokens could not be replaced.

@return string|Stringable The value with tokens replaced.
Replaces tokens with their values .