src/NormalizeStringableCapableTrait.php
protected function _normalizeStringable($stringable)
    {
        if (!is_scalar($stringable)
            && !($stringable instanceof Stringable)
        ) {
            throw $this->_createInvalidArgumentException($this->__('Not a stringable value'), null, null, $stringable);
        }

        return $stringable;
    }
protected function _normalizeStringable($stringable)
    {
        if (!is_scalar($stringable)
            && !($stringable instanceof Stringable)
        ) {
            throw $this->_createInvalidArgumentException($this->__('Not a stringable value'), null, null, $stringable);
        }

        return $stringable;
    }
protected function _normalizeStringable ( $ stringable ) { if ( ! is_scalar ( $ stringable ) && ! ( $ stringable instanceof Stringable ) ) { throw $ this -> _createInvalidArgumentException ( $ this -> __ ( 'Not a stringable value' ) , null , null , $ stringable ) ; } return $ stringable ; }
Normalizes a stringable value.

Useful to make sure that a value can be converted to string in a meaningful way.

@since [*next-version*]

@param Stringable|string|int|float|bool $stringable The value to normalize.
Can be an object that implements {@see Stringable}, or scalar type -
basically anything that can be converted to a string in a meaningful way.

@throws InvalidArgumentException If the value could not be normalized.

@return Stringable|string|int|float|bool The normalized stringable.
If the original value was stringable, that same value will be returned without any modification.
Normalizes a stringable value .