<?php
namespace Symfony\Component\String;
use Symfony\Component\String\Exception\ExceptionInterface;
use Symfony\Component\String\Exception\InvalidArgumentException;
class UnicodeString extends AbstractUnicodeString
{
public function __construct(string $string = '')
{
if ('' === $string || normalizer_is_normalized($this->string = $string)) {
return;
}
if (false === $string = normalizer_normalize($string)) {
throw new InvalidArgumentException('Invalid UTF-8 string.');
}
$this->string = $string;