public static function castString($value): string
    {
        if ($value !== null && !is_scalar($value)) {
            throw new InvalidArgumentException('Value could not be parsed to string');
        }

        return (string)$value;
    }
public static function castString($value): string
    {
        if ($value !== null && !is_scalar($value)) {
            throw new InvalidArgumentException('Value could not be parsed to string');
        }

        return (string)$value;
    }
public static function castString ( $ value ) : string { if ( $ value !== null && ! is_scalar ( $ value ) ) { throw new InvalidArgumentException ( 'Value could not be parsed to string' ) ; } return ( string ) $ value ; }
Converts the representation of a string to its string equivalent.

@param mixed $value the representation of a string

@return string the array equivalent
Converts the representation of a string to its string equivalent .