File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -49,18 +49,10 @@ public static function createLazy(callable $initializer): StringInterface
4949 * @param string $encoding Character encoding to use
5050 * @throws InvalidArgumentException If the encoding is not supported
5151 */
52- public function __construct (string |Stringable $ string , string $ encoding = ' UTF-8 ' )
52+ public function __construct (string |Stringable $ string , ? string $ encoding = null )
5353 {
5454 $ this ->value = (string ) $ string ;
5555 $ this ->encoding = $ encoding ;
56-
57- // Check if encoding is supported
58- if (!in_array ($ this ->encoding , mb_list_encodings (), true )) {
59- throw new InvalidArgumentException (
60- sprintf ('Encoding "%s" is not supported ' , $ this ->encoding )
61- );
62- }
63-
6456 // Determine if the string is multibyte
6557 $ this ->isMultibyte = Stringy::isMultibyte ($ this ->value );
6658 }
You can’t perform that action at this time.
0 commit comments